Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Unified Diff: include/core/SkDevice.h

Issue 68203018: Revert "Revert "switch GatherPixelRefs to use SkBaseDevice instead of SkBitmapDevice"" (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/core/SkBitmapDevice.h ('k') | include/gpu/SkGpuDevice.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkDevice.h
diff --git a/include/core/SkDevice.h b/include/core/SkDevice.h
index 8dce0a49e51f793a03fe2ae909d4df22413c2253..b1f430ec77280cc5a8306cbb423b6feb80c2035c 100644
--- a/include/core/SkDevice.h
+++ b/include/core/SkDevice.h
@@ -83,7 +83,12 @@ public:
* canvas. The root device will have its top-left at 0,0, but other devices
* such as those associated with saveLayer may have a non-zero origin.
*/
- virtual void getGlobalBounds(SkIRect* bounds) const = 0;
+ void getGlobalBounds(SkIRect* bounds) const {
+ SkASSERT(bounds);
+ const SkIPoint& origin = this->getOrigin();
+ bounds->setXYWH(origin.x(), origin.y(), this->width(), this->height());
+ }
+
/** Returns true if the device's bitmap's config treats every pixel as
implicitly opaque.
@@ -383,6 +388,7 @@ private:
// used to change the backend's pixels (and possibly config/rowbytes)
// but cannot change the width/height, so there should be no change to
// any clip information.
+ // TODO: move to SkBitmapDevice
virtual void replaceBitmapBackendForRasterSurface(const SkBitmap&) = 0;
// just called by SkCanvas when built as a layer
« no previous file with comments | « include/core/SkBitmapDevice.h ('k') | include/gpu/SkGpuDevice.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698