diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/core/SkDevice.h | 4 | ||||
-rw-r--r-- | include/gpu/SkGpuDevice.h | 15 |
2 files changed, 17 insertions, 2 deletions
diff --git a/include/core/SkDevice.h b/include/core/SkDevice.h index 42624bf4bb..ed1c8fd63b 100644 --- a/include/core/SkDevice.h +++ b/include/core/SkDevice.h @@ -85,7 +85,7 @@ public: */ virtual void getGlobalBounds(SkIRect* bounds) const = 0; - /** Returns true if the device's bitmap's config treats every pixels as + /** Returns true if the device's bitmap's config treats every pixel as implicitly opaque. */ virtual bool isOpaque() const = 0; @@ -332,7 +332,7 @@ protected: int x, int y, SkCanvas::Config8888 config8888) = 0; - /** Called when this device is installed into a Canvas. Balanaced by a call + /** Called when this device is installed into a Canvas. Balanced by a call to unlockPixels() when the device is removed from a Canvas. */ virtual void lockPixels() = 0; diff --git a/include/gpu/SkGpuDevice.h b/include/gpu/SkGpuDevice.h index 474fc2eb11..f80ef7841b 100644 --- a/include/gpu/SkGpuDevice.h +++ b/include/gpu/SkGpuDevice.h @@ -63,6 +63,21 @@ public: virtual GrRenderTarget* accessRenderTarget() SK_OVERRIDE; // overrides from SkBaseDevice + virtual uint32_t getDeviceCapabilities() SK_OVERRIDE { + return 0; + } + virtual int width() const SK_OVERRIDE { + return NULL == fRenderTarget ? 0 : fRenderTarget->width(); + } + virtual int height() const SK_OVERRIDE { + return NULL == fRenderTarget ? 0 : fRenderTarget->height(); + } + virtual void getGlobalBounds(SkIRect* bounds) const SK_OVERRIDE; + virtual bool isOpaque() const SK_OVERRIDE { + return NULL == fRenderTarget ? false + : kRGB_565_GrPixelConfig == fRenderTarget->config(); + } + virtual SkBitmap::Config config() const SK_OVERRIDE; virtual void clear(SkColor color) SK_OVERRIDE; virtual void writePixels(const SkBitmap& bitmap, int x, int y, |