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 334993002: hide virtuals on device for width/height/isopaque (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 6 months 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/core/SkImageInfo.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 25ad4993869f5eb833c8fdc9db081e7b97b342b3..4b3db126f161a43a3a2481b5a99f222d7530b8b6 100644
--- a/include/core/SkDevice.h
+++ b/include/core/SkDevice.h
@@ -44,13 +44,6 @@ public:
SkMetaData& getMetaData();
- /** Return the width of the device (in pixels).
- */
- virtual int width() const = 0;
- /** Return the height of the device (in pixels).
- */
- virtual int height() const = 0;
-
/** Return the image properties of the device. */
virtual const SkDeviceProperties& getDeviceProperties() const {
//Currently, all the properties are leaky.
@@ -74,10 +67,27 @@ public:
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.
- */
- virtual bool isOpaque() const = 0;
+#ifdef SK_SUPPORT_LEGACY_DEVICE_VIRTUAL_ISOPAQUE
+ virtual int width() const {
+ return this->imageInfo().width();
+ }
+ virtual int height() const {
+ return this->imageInfo().height();
+ }
+ virtual bool isOpaque() const {
+ return this->imageInfo().isOpaque();
+ }
+#else
+ int width() const {
+ return this->imageInfo().width();
+ }
+ int height() const {
+ return this->imageInfo().height();
+ }
+ bool isOpaque() const {
+ return this->imageInfo().isOpaque();
+ }
+#endif
/** Return the bitmap associated with this device. Call this each time you need
to access the bitmap, as it notifies the subclass to perform any flushing
« no previous file with comments | « include/core/SkBitmapDevice.h ('k') | include/core/SkImageInfo.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698