eliminate (unused) extra param to update(), and thereby remove (bad bad bad) setBitmapDevice call.

git-svn-id: http://skia.googlecode.com/svn/trunk@5716 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
reed@google.com 2012-09-27 20:58:01 +00:00
parent d86e7ab604
commit 4c9e2aa7c7
2 changed files with 9 additions and 15 deletions

View File

@ -38,7 +38,7 @@ public:
void eraseRGB(U8CPU r, U8CPU g, U8CPU b);
bool isDirty() const { return !fDirtyRgn.isEmpty(); }
bool update(SkIRect* updateArea, SkCanvas* = NULL);
bool updatex(SkIRect* updateArea);
// does not call through to onHandleInval(), but does force the fDirtyRgn
// to be wide open. Call before update() to ensure we redraw everything.
void forceInvalAll();

View File

@ -156,7 +156,7 @@ void SkWindow::forceInvalAll() {
extern bool gEnableControlledThrow;
#endif
bool SkWindow::update(SkIRect* updateArea, SkCanvas* canvas)
bool SkWindow::updatex(SkIRect* updateArea)
{
if (!fDirtyRgn.isEmpty())
{
@ -172,20 +172,14 @@ bool SkWindow::update(SkIRect* updateArea, SkCanvas* canvas)
bm.setPixels(buffer);
#endif
SkCanvas rasterCanvas(bm);
SkCanvas rasterCanvas;
if (NULL == canvas) {
canvas = &rasterCanvas;
}
canvas->setBitmapDevice(bm);
canvas->clipRegion(fDirtyRgn);
rasterCanvas.clipRegion(fDirtyRgn);
if (updateArea)
*updateArea = fDirtyRgn.getBounds();
SkAutoCanvasRestore acr(canvas, true);
canvas->concat(fMatrix);
SkAutoCanvasRestore acr(&rasterCanvas, true);
rasterCanvas.concat(fMatrix);
// empty this now, so we can correctly record any inval calls that
// might be made during the draw call.
@ -193,7 +187,7 @@ bool SkWindow::update(SkIRect* updateArea, SkCanvas* canvas)
#ifdef TEST_BOUNDER
test_bounder b(bm);
canvas->setBounder(&b);
rasterCanvas.setBounder(&b);
#endif
#ifdef SK_SIMULATE_FAILED_MALLOC
gEnableControlledThrow = true;
@ -205,13 +199,13 @@ bool SkWindow::update(SkIRect* updateArea, SkCanvas* canvas)
//catch (...) {
//}
#else
this->draw(canvas);
this->draw(&rasterCanvas);
#endif
#ifdef SK_SIMULATE_FAILED_MALLOC
gEnableControlledThrow = false;
#endif
#ifdef TEST_BOUNDER
canvas->setBounder(NULL);
rasterCanvas.setBounder(NULL);
#endif
#if defined(SK_BUILD_FOR_WINCE) && defined(USE_GX_SCREEN)