Change undefined SkGpuRenderTarget and SkGpuTexture forward declares to GrRenderTarge...
authorcommit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>
Wed, 26 Jun 2013 19:18:23 +0000 (19:18 +0000)
committercommit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>
Wed, 26 Jun 2013 19:18:23 +0000 (19:18 +0000)
R=robertphillips@google.com, reed@google.com

Author: bsalomon@google.com

Review URL: https://chromiumcodereview.appspot.com/17269003

git-svn-id: http://skia.googlecode.com/svn/trunk@9775 2bbb7eff-a529-9590-31e7-b0007b416f81

18 files changed:
gm/texdata.cpp
include/core/SkBitmap.h
include/core/SkDevice.h
include/core/SkPixelRef.h
include/gpu/SkGpuDevice.h
include/gpu/SkGrPixelRef.h
src/core/SkBitmap.cpp
src/core/SkImageFilter.cpp
src/effects/SkBicubicImageFilter.cpp
src/effects/SkBlendImageFilter.cpp
src/effects/SkBlurImageFilter.cpp
src/effects/SkDisplacementMapEffect.cpp
src/effects/SkMorphologyImageFilter.cpp
src/effects/SkXfermodeImageFilter.cpp
src/gpu/SkGpuDevice.cpp
src/gpu/SkGrPixelRef.cpp
src/image/SkSurface_Gpu.cpp
src/utils/SkDeferredCanvas.cpp

index 410fa6d2542d2f2c1ecb0b6e4b33cf8bb738e2bb..6281825d25c04bf272f823b647241cb2cda8af67 100644 (file)
@@ -39,7 +39,7 @@ protected:
 
     virtual void onDraw(SkCanvas* canvas) {
         SkDevice* device = canvas->getTopDevice();
-        GrRenderTarget* target = (GrRenderTarget*) device->accessRenderTarget();
+        GrRenderTarget* target = device->accessRenderTarget();
         GrContext* ctx = GetGr();
         if (ctx && target) {
             SkPMColor gTextureData[(2 * S) * (2 * S)];
index dd9dc61bc03314d624ba39ca5b60691e0e97c11e..bc43348e021f85e95a46dbd3138fdfb771f698a6 100644 (file)
@@ -23,8 +23,7 @@ class SkPixelRef;
 class SkRegion;
 class SkString;
 
-// This is an opaque class, not interpreted by skia
-class SkGpuTexture;
+class GrTexture;
 
 /** \class SkBitmap
 
@@ -365,7 +364,7 @@ public:
 
     /** Returns the pixelRef's texture, or NULL
      */
-    SkGpuTexture* getTexture() const;
+    GrTexture* getTexture() const;
 
     /** Return the bitmap's colortable, if it uses one (i.e. fConfig is
         kIndex8_Config) and the pixels are locked.
index 3d915d8b55dac86e31679ad938cbf000d4a60f15..162d882e852761201be6c216ff991af121b0fd07 100644 (file)
@@ -23,8 +23,7 @@ class SkMatrix;
 class SkMetaData;
 class SkRegion;
 
-// This is an opaque class, not interpreted by skia
-class SkGpuRenderTarget;
+class GrRenderTarget;
 
 class SK_API SkDevice : public SkRefCnt {
 public:
@@ -160,7 +159,7 @@ public:
     /**
      * Return the device's associated gpu render target, or NULL.
      */
-    virtual SkGpuRenderTarget* accessRenderTarget() { return NULL; }
+    virtual GrRenderTarget* accessRenderTarget() { return NULL; }
 
 
     /**
index 89ce69ae5bd1a9e020bf38df1653583a6436f094..0487e426109a2e84381e84aff4638ec0c6eccfb3 100644 (file)
@@ -34,8 +34,7 @@ class SkData;
 struct SkIRect;
 class SkMutex;
 
-// this is an opaque class, not interpreted by skia
-class SkGpuTexture;
+class GrTexture;
 
 /** \class SkPixelRef
 
@@ -144,7 +143,7 @@ public:
 
     /** Are we really wrapping a texture instead of a bitmap?
      */
-    virtual SkGpuTexture* getTexture() { return NULL; }
+    virtual GrTexture* getTexture() { return NULL; }
 
     bool readPixels(SkBitmap* dst, const SkIRect* subset = NULL);
 
index ab247033106dc302fbe87d628181cdc3fdc9919f..0dd363fa36f22489737aec1e000a2d21038a1e8d 100644 (file)
@@ -60,7 +60,7 @@ public:
 
     GrContext* context() const { return fContext; }
 
-    virtual SkGpuRenderTarget* accessRenderTarget() SK_OVERRIDE;
+    virtual GrRenderTarget* accessRenderTarget() SK_OVERRIDE;
 
     // overrides from SkDevice
 
index ec1e22ec0204cc482f4214a80b22af0c2258619e..da4b8fae090dfab8d0fd6860426a612a5d5de52f 100644 (file)
@@ -51,7 +51,7 @@ public:
     virtual ~SkGrPixelRef();
 
     // override from SkPixelRef
-    virtual SkGpuTexture* getTexture() SK_OVERRIDE;
+    virtual GrTexture* getTexture() SK_OVERRIDE;
 
     SK_DECLARE_UNFLATTENABLE_OBJECT()
 
index a0428655f2024108f4a752441395615275584f8e..f164ca570a46101ae85b673be8daab489ac958bc 100644 (file)
@@ -424,7 +424,7 @@ void SkBitmap::notifyPixelsChanged() const {
     }
 }
 
-SkGpuTexture* SkBitmap::getTexture() const {
+GrTexture* SkBitmap::getTexture() const {
     return fPixelRef ? fPixelRef->getTexture() : NULL;
 }
 
index 37d1f44fd450ce7a4d96aabf34e19aae5d1e55e2..9f16b4a0c85e02d751cdf756eb1bf00dc3baad2c 100644 (file)
@@ -105,7 +105,7 @@ bool SkImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, SkBitmap*
     if (!SkImageFilterUtils::GetInputResultGPU(this->getInput(0), proxy, src, &input)) {
         return false;
     }
-    GrTexture* srcTexture = (GrTexture*) input.getTexture();
+    GrTexture* srcTexture = input.getTexture();
     SkRect rect;
     src.getBounds(&rect);
     GrContext* context = srcTexture->getContext();
index daa59484fab135982a94ec87267378ed5534367a..2d0a17a116d5f15d09e576faf8cb0046c306fcc6 100644 (file)
@@ -346,7 +346,7 @@ bool SkBicubicImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, SkB
     if (!SkImageFilterUtils::GetInputResultGPU(getInput(0), proxy, src, &srcBM)) {
         return false;
     }
-    GrTexture* srcTexture = (GrTexture*) srcBM.getTexture();
+    GrTexture* srcTexture = srcBM.getTexture();
     GrContext* context = srcTexture->getContext();
 
     SkRect dstRect = SkRect::MakeWH(srcBM.width() * fScale.fWidth,
index 330e87d76d8e8410477bf6b136a552a5422c4bfd..4f61ed80002acdb0d2ff82b65bec0c25ccc120ae 100644 (file)
@@ -155,12 +155,12 @@ bool SkBlendImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, SkBit
     if (!SkImageFilterUtils::GetInputResultGPU(getBackgroundInput(), proxy, src, &backgroundBM)) {
         return false;
     }
-    GrTexture* background = (GrTexture*) backgroundBM.getTexture();
+    GrTexture* background = backgroundBM.getTexture();
     SkBitmap foregroundBM;
     if (!SkImageFilterUtils::GetInputResultGPU(getForegroundInput(), proxy, src, &foregroundBM)) {
         return false;
     }
-    GrTexture* foreground = (GrTexture*) foregroundBM.getTexture();
+    GrTexture* foreground = foregroundBM.getTexture();
     GrContext* context = foreground->getContext();
 
     GrTextureDesc desc;
index 7b68ea0214fafa8967cfa3e3f9cf7da16593b89f..36d0afd35e558f069774c0bbb614d0d2584726d0 100644 (file)
@@ -198,7 +198,7 @@ bool SkBlurImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, SkBitm
     if (!SkImageFilterUtils::GetInputResultGPU(getInput(0), proxy, src, &input)) {
         return false;
     }
-    GrTexture* source = (GrTexture*) input.getTexture();
+    GrTexture* source = input.getTexture();
     SkRect rect;
     src.getBounds(&rect);
     SkAutoTUnref<GrTexture> tex(source->getContext()->gaussianBlur(source, false, rect,
index f81f32fb9652e4a68438cc2d66ce52a6bf63a1dc..7c99c023f8adb4cd58ed5e9869c0a2691d5b8dad 100644 (file)
@@ -280,12 +280,12 @@ bool SkDisplacementMapEffect::filterImageGPU(Proxy* proxy, const SkBitmap& src,
     if (!SkImageFilterUtils::GetInputResultGPU(getColorInput(), proxy, src, &colorBM)) {
         return false;
     }
-    GrTexture* color = (GrTexture*) colorBM.getTexture();
+    GrTexture* color = colorBM.getTexture();
     SkBitmap displacementBM;
     if (!SkImageFilterUtils::GetInputResultGPU(getDisplacementInput(), proxy, src, &displacementBM)) {
         return false;
     }
-    GrTexture* displacement = (GrTexture*) displacementBM.getTexture();
+    GrTexture* displacement = displacementBM.getTexture();
     GrContext* context = color->getContext();
 
     GrTextureDesc desc;
index be63d15b10ea045f7ec2195950c9f7b6be65a094..cbee8500ac85588eab5f55c835a1f5a84eeb2ba2 100644 (file)
@@ -507,7 +507,7 @@ bool SkDilateImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, SkBi
     if (!SkImageFilterUtils::GetInputResultGPU(getInput(0), proxy, src, &inputBM)) {
         return false;
     }
-    GrTexture* input = (GrTexture*) inputBM.getTexture();
+    GrTexture* input = inputBM.getTexture();
     SkIRect bounds;
     src.getBounds(&bounds);
     SkAutoTUnref<GrTexture> resultTex(apply_morphology(input, bounds,
@@ -520,7 +520,7 @@ bool SkErodeImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, SkBit
     if (!SkImageFilterUtils::GetInputResultGPU(getInput(0), proxy, src, &inputBM)) {
         return false;
     }
-    GrTexture* input = (GrTexture*) inputBM.getTexture();
+    GrTexture* input = inputBM.getTexture();
     SkIRect bounds;
     src.getBounds(&bounds);
     SkAutoTUnref<GrTexture> resultTex(apply_morphology(input, bounds,
index a7f50c30cd08d0f17c7aba56ec70b707c4f5c9b7..c26ca18041ffb9315e955a96a089ee996d34f2fd 100644 (file)
@@ -70,12 +70,12 @@ bool SkXfermodeImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, Sk
     if (!SkImageFilterUtils::GetInputResultGPU(getInput(0), proxy, src, &background)) {
         return false;
     }
-    GrTexture* backgroundTex = (GrTexture*) background.getTexture();
+    GrTexture* backgroundTex = background.getTexture();
     SkBitmap foreground;
     if (!SkImageFilterUtils::GetInputResultGPU(getInput(1), proxy, src, &foreground)) {
         return false;
     }
-    GrTexture* foregroundTex = (GrTexture*) foreground.getTexture();
+    GrTexture* foregroundTex = foreground.getTexture();
     GrContext* context = foregroundTex->getContext();
 
     GrEffectRef* xferEffect = NULL;
index 22f01f92e81ce2076d517119887f8b344c79ddb7..bfc3695f3efa26a5b1e4d1cdf11ec029235f8ac3 100644 (file)
@@ -449,9 +449,9 @@ void SkGpuDevice::prepareDraw(const SkDraw& draw, bool forceIdentity) {
     DO_DEFERRED_CLEAR();
 }
 
-SkGpuRenderTarget* SkGpuDevice::accessRenderTarget() {
+GrRenderTarget* SkGpuDevice::accessRenderTarget() {
     DO_DEFERRED_CLEAR();
-    return (SkGpuRenderTarget*)fRenderTarget;
+    return fRenderTarget;
 }
 
 bool SkGpuDevice::bindDeviceAsTexture(GrPaint* paint) {
@@ -1494,8 +1494,8 @@ void SkGpuDevice::drawSprite(const SkDraw& draw, const SkBitmap& bitmap,
         SkBitmap filterBitmap;
         if (filter_texture(this, fContext, texture, filter, w, h, &filterBitmap)) {
             grPaint.colorStage(kBitmapEffectIdx)->setEffect(
-                GrSimpleTextureEffect::Create((GrTexture*) filterBitmap.getTexture(), SkMatrix::I()))->unref();
-            texture = (GrTexture*) filterBitmap.getTexture();
+                GrSimpleTextureEffect::Create(filterBitmap.getTexture(), SkMatrix::I()))->unref();
+            texture = filterBitmap.getTexture();
             w = filterBitmap.width();
             h = filterBitmap.height();
         }
@@ -1571,8 +1571,8 @@ void SkGpuDevice::drawDevice(const SkDraw& draw, SkDevice* device,
         SkBitmap filterBitmap;
         if (filter_texture(this, fContext, devTex, filter, w, h, &filterBitmap)) {
             grPaint.colorStage(kBitmapEffectIdx)->setEffect(
-                GrSimpleTextureEffect::Create((GrTexture*) filterBitmap.getTexture(), SkMatrix::I()))->unref();
-            devTex = (GrTexture*) filterBitmap.getTexture();
+                GrSimpleTextureEffect::Create(filterBitmap.getTexture(), SkMatrix::I()))->unref();
+            devTex = filterBitmap.getTexture();
             w = filterBitmap.width();
             h = filterBitmap.height();
         }
index 8751c5d8bf4e408959809bca842c6b0013fba1eb..98819bfd73a4fab9e5a3bf152f2fd068b264d92f 100644 (file)
@@ -128,9 +128,9 @@ SkGrPixelRef::~SkGrPixelRef() {
     GrSafeUnref(fSurface);
 }
 
-SkGpuTexture* SkGrPixelRef::getTexture() {
+GrTexture* SkGrPixelRef::getTexture() {
     if (NULL != fSurface) {
-        return (SkGpuTexture*) fSurface->asTexture();
+        return fSurface->asTexture();
     }
     return NULL;
 }
index 154f1793f05089784a603e449b3f868c7fe76212..75c3890eb5faa187d0db40c98c33424450deaf44 100644 (file)
@@ -66,14 +66,14 @@ SkCanvas* SkSurface_Gpu::onNewCanvas() {
 }
 
 SkSurface* SkSurface_Gpu::onNewSurface(const SkImage::Info& info) {
-    GrRenderTarget* rt = (GrRenderTarget*) fDevice->accessRenderTarget();
+    GrRenderTarget* rt = fDevice->accessRenderTarget();
     int sampleCount = rt->numSamples();
     return SkSurface::NewRenderTarget(fDevice->context(), info, sampleCount);
 }
 
 SkImage* SkSurface_Gpu::onNewImageSnapshot() {
 
-    GrRenderTarget* rt = (GrRenderTarget*) fDevice->accessRenderTarget();
+    GrRenderTarget* rt = fDevice->accessRenderTarget();
 
     return SkImage::NewTexture(rt->asTexture());
 }
@@ -87,7 +87,7 @@ void SkSurface_Gpu::onDraw(SkCanvas* canvas, SkScalar x, SkScalar y,
 // device into it. Note that this flushes the SkGpuDevice but
 // doesn't force an OpenGL flush.
 void SkSurface_Gpu::onCopyOnWrite(ContentChangeMode mode) {
-    GrRenderTarget* rt = (GrRenderTarget*) fDevice->accessRenderTarget();
+    GrRenderTarget* rt = fDevice->accessRenderTarget();
     // are we sharing our render target with the image?
     SkASSERT(NULL != this->getCachedImage());
     if (rt->asTexture() == SkTextureImageGetTexture(this->getCachedImage())) {
index 89997a1f3f09ad48cf8c243c81d5849579717c09..da3c72e22ce6dbf2197ce8218fe540a01d1d9caa 100644 (file)
@@ -163,7 +163,7 @@ public:
     virtual uint32_t getDeviceCapabilities() SK_OVERRIDE;
     virtual int width() const SK_OVERRIDE;
     virtual int height() const SK_OVERRIDE;
-    virtual SkGpuRenderTarget* accessRenderTarget() SK_OVERRIDE;
+    virtual GrRenderTarget* accessRenderTarget() SK_OVERRIDE;
 
     virtual SkDevice* onCreateCompatibleDevice(SkBitmap::Config config,
                                                int width, int height,
@@ -435,7 +435,7 @@ int DeferredDevice::height() const {
     return immediateDevice()->height();
 }
 
-SkGpuRenderTarget* DeferredDevice::accessRenderTarget() {
+GrRenderTarget* DeferredDevice::accessRenderTarget() {
     this->flushPendingCommands(kNormal_PlaybackMode);
     return immediateDevice()->accessRenderTarget();
 }