return fRenderTargetProxy->instantiate(fContext->textureProvider());
}
- GrTextureProxy* asDeferredTexture();
+ GrSurfaceProxy* asDeferredSurface() override { return fRenderTargetProxy.get(); }
+ GrTextureProxy* asDeferredTexture() override;
+ GrRenderTargetProxy* asDeferredRenderTarget() override { return fRenderTargetProxy.get(); }
sk_sp<GrTexture> asTexture() {
if (!this->accessRenderTarget()) {
class GrAuditTrail;
class GrContext;
+class GrRenderTargetProxy;
class GrSingleOwner;
class GrSurface;
+class GrSurfaceProxy;
+class GrTextureProxy;
struct SkIPoint;
struct SkIRect;
virtual bool copySurface(GrSurface* src, const SkIRect& srcRect, const SkIPoint& dstPoint) = 0;
+ // TODO: this is virtual b.c. this object doesn't have a pointer to the wrapped GrSurfaceProxy?
+ virtual GrSurfaceProxy* asDeferredSurface() = 0;
+ virtual GrTextureProxy* asDeferredTexture() = 0;
+ virtual GrRenderTargetProxy* asDeferredRenderTarget() = 0;
+
GrAuditTrail* auditTrail() { return fAuditTrail; }
protected:
bool copySurface(GrSurface* src, const SkIRect& srcRect, const SkIPoint& dstPoint) override;
+ GrSurfaceProxy* asDeferredSurface() override { return fTextureProxy.get(); }
+ GrTextureProxy* asDeferredTexture() override { return fTextureProxy.get(); }
+ GrRenderTargetProxy* asDeferredRenderTarget() override;
+
protected:
GrTextureContext(GrContext*, GrDrawingManager*, sk_sp<GrTextureProxy>, GrAuditTrail*,
GrSingleOwner*);
SkSafeUnref(fOpList);
}
+GrRenderTargetProxy* GrTextureContext::asDeferredRenderTarget() {
+ // If the proxy can return an RTProxy it should've been wrapped in a RTContext
+ SkASSERT(!fTextureProxy->asRenderTargetProxy());
+ return nullptr;
+}
+
GrTextureOpList* GrTextureContext::getOpList() {
ASSERT_SINGLE_OWNER
SkDEBUGCODE(this->validate();)