diff options
author | robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-09-17 12:26:23 +0000 |
---|---|---|
committer | robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-09-17 12:26:23 +0000 |
commit | 07f81a57ba5720fd65563077114bd9e5ba840151 (patch) | |
tree | 346963830e041065d5ef284a00d59eb6b8216141 /src | |
parent | 6a6c6a16db2f2ea9565d67443fd62af0765dc7ca (diff) |
Baby step in making SkGpuDevice no longer derive from SkBitmapDevice
https://codereview.chromium.org/23641008/
git-svn-id: http://skia.googlecode.com/svn/trunk@11311 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src')
-rw-r--r-- | src/gpu/SkGpuDevice.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp index ea8a06e632..a5c261c75d 100644 --- a/src/gpu/SkGpuDevice.cpp +++ b/src/gpu/SkGpuDevice.cpp @@ -569,6 +569,23 @@ inline bool skPaint2GrPaintShader(SkGpuDevice* dev, } /////////////////////////////////////////////////////////////////////////////// +void SkGpuDevice::getGlobalBounds(SkIRect* bounds) const { + if (NULL != bounds) { + const SkIPoint& origin = this->getOrigin(); + bounds->setXYWH(origin.x(), origin.y(), + this->width(), this->height()); + } +} + +SkBitmap::Config SkGpuDevice::config() const { + if (NULL == fRenderTarget) { + return SkBitmap::kNo_Config; + } + + bool isOpaque; + return grConfig2skConfig(fRenderTarget->config(), &isOpaque); +} + void SkGpuDevice::clear(SkColor color) { SkIRect rect = SkIRect::MakeWH(this->width(), this->height()); fContext->clear(&rect, SkColor2GrColor(color), fRenderTarget); @@ -1554,7 +1571,7 @@ void SkGpuDevice::drawDevice(const SkDraw& draw, SkBaseDevice* device, // drawDevice is defined to be in device coords. CHECK_SHOULD_DRAW(draw, true); - GrRenderTarget* devRT = device->accessRenderTarget(); + GrRenderTarget* devRT = dev->accessRenderTarget(); GrTexture* devTex; if (NULL == (devTex = devRT->asTexture())) { return; |