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)];
class SkRegion;
class SkString;
-// This is an opaque class, not interpreted by skia
-class SkGpuTexture;
+class GrTexture;
/** \class SkBitmap
/** 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.
class SkMetaData;
class SkRegion;
-// This is an opaque class, not interpreted by skia
-class SkGpuRenderTarget;
+class GrRenderTarget;
class SK_API SkDevice : public SkRefCnt {
public:
/**
* Return the device's associated gpu render target, or NULL.
*/
- virtual SkGpuRenderTarget* accessRenderTarget() { return NULL; }
+ virtual GrRenderTarget* accessRenderTarget() { return NULL; }
/**
struct SkIRect;
class SkMutex;
-// this is an opaque class, not interpreted by skia
-class SkGpuTexture;
+class GrTexture;
/** \class SkPixelRef
/** 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);
GrContext* context() const { return fContext; }
- virtual SkGpuRenderTarget* accessRenderTarget() SK_OVERRIDE;
+ virtual GrRenderTarget* accessRenderTarget() SK_OVERRIDE;
// overrides from SkDevice
virtual ~SkGrPixelRef();
// override from SkPixelRef
- virtual SkGpuTexture* getTexture() SK_OVERRIDE;
+ virtual GrTexture* getTexture() SK_OVERRIDE;
SK_DECLARE_UNFLATTENABLE_OBJECT()
}
}
-SkGpuTexture* SkBitmap::getTexture() const {
+GrTexture* SkBitmap::getTexture() const {
return fPixelRef ? fPixelRef->getTexture() : NULL;
}
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();
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,
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;
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,
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;
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,
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,
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;
DO_DEFERRED_CLEAR();
}
-SkGpuRenderTarget* SkGpuDevice::accessRenderTarget() {
+GrRenderTarget* SkGpuDevice::accessRenderTarget() {
DO_DEFERRED_CLEAR();
- return (SkGpuRenderTarget*)fRenderTarget;
+ return fRenderTarget;
}
bool SkGpuDevice::bindDeviceAsTexture(GrPaint* paint) {
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();
}
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();
}
GrSafeUnref(fSurface);
}
-SkGpuTexture* SkGrPixelRef::getTexture() {
+GrTexture* SkGrPixelRef::getTexture() {
if (NULL != fSurface) {
- return (SkGpuTexture*) fSurface->asTexture();
+ return fSurface->asTexture();
}
return NULL;
}
}
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());
}
// 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())) {
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,
return immediateDevice()->height();
}
-SkGpuRenderTarget* DeferredDevice::accessRenderTarget() {
+GrRenderTarget* DeferredDevice::accessRenderTarget() {
this->flushPendingCommands(kNormal_PlaybackMode);
return immediateDevice()->accessRenderTarget();
}