diff --git a/gm/texdata.cpp b/gm/texdata.cpp index 410fa6d254..6281825d25 100644 --- a/gm/texdata.cpp +++ b/gm/texdata.cpp @@ -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)]; diff --git a/include/core/SkBitmap.h b/include/core/SkBitmap.h index dd9dc61bc0..bc43348e02 100644 --- a/include/core/SkBitmap.h +++ b/include/core/SkBitmap.h @@ -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. diff --git a/include/core/SkDevice.h b/include/core/SkDevice.h index 3d915d8b55..162d882e85 100644 --- a/include/core/SkDevice.h +++ b/include/core/SkDevice.h @@ -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; } /** diff --git a/include/core/SkPixelRef.h b/include/core/SkPixelRef.h index 89ce69ae5b..0487e42610 100644 --- a/include/core/SkPixelRef.h +++ b/include/core/SkPixelRef.h @@ -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); diff --git a/include/gpu/SkGpuDevice.h b/include/gpu/SkGpuDevice.h index ab24703310..0dd363fa36 100644 --- a/include/gpu/SkGpuDevice.h +++ b/include/gpu/SkGpuDevice.h @@ -60,7 +60,7 @@ public: GrContext* context() const { return fContext; } - virtual SkGpuRenderTarget* accessRenderTarget() SK_OVERRIDE; + virtual GrRenderTarget* accessRenderTarget() SK_OVERRIDE; // overrides from SkDevice diff --git a/include/gpu/SkGrPixelRef.h b/include/gpu/SkGrPixelRef.h index ec1e22ec02..da4b8fae09 100644 --- a/include/gpu/SkGrPixelRef.h +++ b/include/gpu/SkGrPixelRef.h @@ -51,7 +51,7 @@ public: virtual ~SkGrPixelRef(); // override from SkPixelRef - virtual SkGpuTexture* getTexture() SK_OVERRIDE; + virtual GrTexture* getTexture() SK_OVERRIDE; SK_DECLARE_UNFLATTENABLE_OBJECT() diff --git a/src/core/SkBitmap.cpp b/src/core/SkBitmap.cpp index a0428655f2..f164ca570a 100644 --- a/src/core/SkBitmap.cpp +++ b/src/core/SkBitmap.cpp @@ -424,7 +424,7 @@ void SkBitmap::notifyPixelsChanged() const { } } -SkGpuTexture* SkBitmap::getTexture() const { +GrTexture* SkBitmap::getTexture() const { return fPixelRef ? fPixelRef->getTexture() : NULL; } diff --git a/src/core/SkImageFilter.cpp b/src/core/SkImageFilter.cpp index 37d1f44fd4..9f16b4a0c8 100644 --- a/src/core/SkImageFilter.cpp +++ b/src/core/SkImageFilter.cpp @@ -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(); diff --git a/src/effects/SkBicubicImageFilter.cpp b/src/effects/SkBicubicImageFilter.cpp index daa59484fa..2d0a17a116 100644 --- a/src/effects/SkBicubicImageFilter.cpp +++ b/src/effects/SkBicubicImageFilter.cpp @@ -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, diff --git a/src/effects/SkBlendImageFilter.cpp b/src/effects/SkBlendImageFilter.cpp index 330e87d76d..4f61ed8000 100644 --- a/src/effects/SkBlendImageFilter.cpp +++ b/src/effects/SkBlendImageFilter.cpp @@ -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; diff --git a/src/effects/SkBlurImageFilter.cpp b/src/effects/SkBlurImageFilter.cpp index 7b68ea0214..36d0afd35e 100644 --- a/src/effects/SkBlurImageFilter.cpp +++ b/src/effects/SkBlurImageFilter.cpp @@ -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 tex(source->getContext()->gaussianBlur(source, false, rect, diff --git a/src/effects/SkDisplacementMapEffect.cpp b/src/effects/SkDisplacementMapEffect.cpp index f81f32fb96..7c99c023f8 100644 --- a/src/effects/SkDisplacementMapEffect.cpp +++ b/src/effects/SkDisplacementMapEffect.cpp @@ -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; diff --git a/src/effects/SkMorphologyImageFilter.cpp b/src/effects/SkMorphologyImageFilter.cpp index be63d15b10..cbee8500ac 100644 --- a/src/effects/SkMorphologyImageFilter.cpp +++ b/src/effects/SkMorphologyImageFilter.cpp @@ -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 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 resultTex(apply_morphology(input, bounds, diff --git a/src/effects/SkXfermodeImageFilter.cpp b/src/effects/SkXfermodeImageFilter.cpp index a7f50c30cd..c26ca18041 100644 --- a/src/effects/SkXfermodeImageFilter.cpp +++ b/src/effects/SkXfermodeImageFilter.cpp @@ -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; diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp index 22f01f92e8..bfc3695f3e 100644 --- a/src/gpu/SkGpuDevice.cpp +++ b/src/gpu/SkGpuDevice.cpp @@ -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(); } diff --git a/src/gpu/SkGrPixelRef.cpp b/src/gpu/SkGrPixelRef.cpp index 8751c5d8bf..98819bfd73 100644 --- a/src/gpu/SkGrPixelRef.cpp +++ b/src/gpu/SkGrPixelRef.cpp @@ -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; } diff --git a/src/image/SkSurface_Gpu.cpp b/src/image/SkSurface_Gpu.cpp index 154f1793f0..75c3890eb5 100644 --- a/src/image/SkSurface_Gpu.cpp +++ b/src/image/SkSurface_Gpu.cpp @@ -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())) { diff --git a/src/utils/SkDeferredCanvas.cpp b/src/utils/SkDeferredCanvas.cpp index 89997a1f3f..da3c72e22c 100644 --- a/src/utils/SkDeferredCanvas.cpp +++ b/src/utils/SkDeferredCanvas.cpp @@ -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(); }