Index: src/views/SkWindow.cpp |
diff --git a/src/views/SkWindow.cpp b/src/views/SkWindow.cpp |
index 99c2d30e8a6afe44c6fcb8c9950df1e046f9614a..90ef2804e672cb956a6c1ac2e0e9e141e00335ea 100644 |
--- a/src/views/SkWindow.cpp |
+++ b/src/views/SkWindow.cpp |
@@ -1,14 +1,14 @@ |
- |
/* |
* Copyright 2011 Google Inc. |
* |
* Use of this source code is governed by a BSD-style license that can be |
* found in the LICENSE file. |
*/ |
+ |
#include "SkWindow.h" |
#include "SkCanvas.h" |
-#include "SkDevice.h" |
#include "SkOSMenu.h" |
+#include "SkSurface.h" |
#include "SkSystemEventTypes.h" |
#include "SkTime.h" |
@@ -32,8 +32,9 @@ SkWindow::~SkWindow() { |
fMenus.deleteAll(); |
} |
-SkCanvas* SkWindow::createCanvas() { |
- return new SkCanvas(this->getBitmap()); |
+SkSurface* SkWindow::createSurface() { |
+ const SkBitmap& bm = this->getBitmap(); |
+ return SkSurface::NewRasterDirect(bm.info(), bm.getPixels(), bm.rowBytes()); |
} |
void SkWindow::setMatrix(const SkMatrix& matrix) { |
@@ -126,7 +127,8 @@ bool SkWindow::update(SkIRect* updateArea) { |
bm.setPixels(buffer); |
#endif |
- SkAutoTUnref<SkCanvas> canvas(this->createCanvas()); |
+ SkAutoTUnref<SkSurface> surface(this->createSurface()); |
+ SkCanvas* canvas = surface->getCanvas(); |
canvas->clipRegion(fDirtyRgn); |
if (updateArea) |