aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-09-17 12:26:23 +0000
committerGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-09-17 12:26:23 +0000
commit07f81a57ba5720fd65563077114bd9e5ba840151 (patch)
tree346963830e041065d5ef284a00d59eb6b8216141 /src
parent6a6c6a16db2f2ea9565d67443fd62af0765dc7ca (diff)
Baby step in making SkGpuDevice no longer derive from SkBitmapDevice
Diffstat (limited to 'src')
-rw-r--r--src/gpu/SkGpuDevice.cpp19
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;