aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrSurfaceProxy.cpp
diff options
context:
space:
mode:
authorGravatar Brian Osman <brianosman@google.com>2016-11-23 09:37:01 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-11-23 15:52:27 +0000
commit45580d3e3024c1536e8e1b2017b704805442b634 (patch)
tree9ed9fe3bdc0d949ec8e83b06691b37b6ffdcc54a /src/gpu/GrSurfaceProxy.cpp
parent07764cefbb18041a77897df3453903b0a2016583 (diff)
Added GrSurfaceContext and GrTextureContext
This lets copy-to-texture to be treated like copy-to-rt. To match current behavior, though, copies to texture are still executed immediately (forcing a flush). Once MDB is enabled, copies to texture will be deferred. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5093 Change-Id: Icc0ce5435507a5f0a237c22eedef879824952367 Reviewed-on: https://skia-review.googlesource.com/5093 Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/GrSurfaceProxy.cpp')
-rw-r--r--src/gpu/GrSurfaceProxy.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/gpu/GrSurfaceProxy.cpp b/src/gpu/GrSurfaceProxy.cpp
index 9de41ef482..95fc8b9a8a 100644
--- a/src/gpu/GrSurfaceProxy.cpp
+++ b/src/gpu/GrSurfaceProxy.cpp
@@ -66,6 +66,14 @@ void GrSurfaceProxy::setLastOpList(GrOpList* opList) {
SkRefCnt_SafeAssign(fLastOpList, opList);
}
+GrRenderTargetOpList* GrSurfaceProxy::getLastRenderTargetOpList() {
+ return fLastOpList ? fLastOpList->asRenderTargetOpList() : nullptr;
+}
+
+GrTextureOpList* GrSurfaceProxy::getLastTextureOpList() {
+ return fLastOpList ? fLastOpList->asTextureOpList() : nullptr;
+}
+
sk_sp<GrSurfaceProxy> GrSurfaceProxy::MakeWrapped(sk_sp<GrSurface> surf) {
if (surf->asTexture()) {
if (surf->asRenderTarget()) {
@@ -109,3 +117,12 @@ sk_sp<GrSurfaceProxy> GrSurfaceProxy::MakeDeferred(const GrCaps& caps,
return GrSurfaceProxy::MakeDeferred(caps, desc, SkBackingFit::kExact, budgeted);
}
+#ifdef SK_DEBUG
+void GrSurfaceProxy::validate(GrContext* context) const {
+ if (fTarget) {
+ SkASSERT(fTarget->getContext() == context);
+ }
+
+ INHERITED::validate();
+}
+#endif