Move GrRenderTargetPriv::maxWindowRectangles to GrRenderTargetContextPriv & GrRenderTargetProxy
This removes a reason to call accessRenderTarget on the GrRenderTargetContext
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4583
Change-Id: I6e8a53ffd5c1fea80f542b70e05744e2991f70f8
Reviewed-on: https://skia-review.googlesource.com/4583
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/GrRenderTargetProxy.cpp b/src/gpu/GrRenderTargetProxy.cpp
index 669f422..8eb335d 100644
--- a/src/gpu/GrRenderTargetProxy.cpp
+++ b/src/gpu/GrRenderTargetProxy.cpp
@@ -36,6 +36,10 @@
, fFlags(fTarget->asRenderTarget()->renderTargetPriv().flags()) {
}
+int GrRenderTargetProxy::maxWindowRectangles(const GrCaps& caps) const {
+ return (fFlags & GrRenderTarget::Flags::kWindowRectsSupport) ? caps.maxWindowRectangles() : 0;
+}
+
GrRenderTarget* GrRenderTargetProxy::instantiate(GrTextureProvider* texProvider) {
SkASSERT(fDesc.fFlags & GrSurfaceFlags::kRenderTarget_GrSurfaceFlag);