Change undefined SkGpuRenderTarget and SkGpuTexture forward declares to GrRenderTarget and GrTexture.

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
This commit is contained in:
commit-bot@chromium.org 2013-06-26 19:18:23 +00:00
parent 18bbba9a9a
commit b8d00db075
18 changed files with 34 additions and 37 deletions

View 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)];

View 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.

View 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; }
/**

View 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);

View File

@ -60,7 +60,7 @@ public:
GrContext* context() const { return fContext; }
virtual SkGpuRenderTarget* accessRenderTarget() SK_OVERRIDE;
virtual GrRenderTarget* accessRenderTarget() SK_OVERRIDE;
// overrides from SkDevice

View 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()

View File

@ -424,7 +424,7 @@ void SkBitmap::notifyPixelsChanged() const {
}
}
SkGpuTexture* SkBitmap::getTexture() const {
GrTexture* SkBitmap::getTexture() const {
return fPixelRef ? fPixelRef->getTexture() : NULL;
}

View 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();

View 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,

View 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;

View 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,

View 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;

View 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,

View 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;

View 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();
}

View 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;
}

View 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())) {

View 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();
}