Skip to content

Commit

Permalink
libgralloc: fix bug of boundary merge
Browse files Browse the repository at this point in the history
  • Loading branch information
joycode committed Apr 13, 2012
1 parent fa7c2cf commit 992eb86
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions mx5x/libgralloc/framebuffer.cpp
Expand Up @@ -258,21 +258,23 @@ class UpdateHelper
{
top_ = top;
}
if (width > width_)
int right = left + width;
if (right > right_)
{
width_ = width;
right_ = right;
}
if (height > height_)
int bottom = top + height;
if (bottom > bottom_)
{
height_ = height;
bottom_ = bottom;
}

// check waveform, gc interval, waiting mode
checkWaveform(mode);
checkType(mode);
checkWaiting(mode);
checkGCInterval(mode);
LOGI("merge result: (%d, %d) -- (%d, %d) -- 0x%x\n", left_, top_, width_, height_, update_mode_);
LOGI("merge result: (%d, %d) -- (%d, %d) -- 0x%x\n", left_, top_, right, bottom, update_mode_);
}

void updateScreen(int fb_dev)
Expand All @@ -296,16 +298,16 @@ class UpdateHelper
LOGI("onyx_display_update: waveform: 0x%x, full: 0x%x, waiting: 0x%x\n", waveform_, full_, waiting_);
update_mode_ = waveform_|full_|waiting_;
}
LOGI("onyx_display_update: (%d, %d) -- (%d, %d) -- 0x%x\n", left_, top_, width_, height_, update_mode_);
update_to_display(left_, top_, width_, height_, update_mode_, fb_dev);
LOGI("onyx_display_update: (%d, %d) -- (%d, %d) -- 0x%x\n", left_, top_, right_, bottom_, update_mode_);
update_to_display(left_, top_, right_ - left_, bottom_ - top_, update_mode_, fb_dev);
clear();
}

private:
void clear()
{
left_ = top_ = INT_MAX;
width_ = height_ = 0;
right_ = bottom_ = -1;
waveform_ = EINK_WAVEFORM_MODE_AUTO;
full_ = EINK_UPDATE_MODE_PARTIAL;
waiting_ = EINK_WAIT_MODE_NOWAIT;
Expand Down Expand Up @@ -380,7 +382,7 @@ class UpdateHelper
private:
int gu_count_;
int gc_interval_;
int left_, top_, width_, height_;
int left_, top_, right_, bottom_;
int waveform_;
int full_;
int waiting_;
Expand Down

0 comments on commit 992eb86

Please sign in to comment.