aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrClipStackClip.cpp
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2018-01-08 13:40:32 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-01-08 19:05:31 +0000
commit1afd4cdb0800e2e395b465da24eb71e0e834dafa (patch)
treed3353e7e4487a86d00002ab882f34ec24347000b /src/gpu/GrClipStackClip.cpp
parent5ec5d677b02c41a3c58609461cd8b62c2feaeddc (diff)
Add GrProxyProvider
This pulls all the proxy tracking & creation functionality out of the GrResourceCache and GrResourceProvider and consolidates it in the GrProxyProvider. Change-Id: I7256f7c544319a70c1bd93dd5a9ccbe5fa0a544f Reviewed-on: https://skia-review.googlesource.com/91501 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'src/gpu/GrClipStackClip.cpp')
-rw-r--r--src/gpu/GrClipStackClip.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/gpu/GrClipStackClip.cpp b/src/gpu/GrClipStackClip.cpp
index 0f647e07b4..ce77369bb7 100644
--- a/src/gpu/GrClipStackClip.cpp
+++ b/src/gpu/GrClipStackClip.cpp
@@ -14,7 +14,7 @@
#include "GrFixedClip.h"
#include "GrGpuResourcePriv.h"
#include "GrRenderTargetContextPriv.h"
-#include "GrResourceProvider.h"
+#include "GrProxyProvider.h"
#include "GrStencilAttachment.h"
#include "GrSWMaskHelper.h"
#include "GrTextureProxy.h"
@@ -324,12 +324,12 @@ static void add_invalidate_on_pop_message(const SkClipStack& stack, uint32_t cli
sk_sp<GrTextureProxy> GrClipStackClip::createAlphaClipMask(GrContext* context,
const GrReducedClip& reducedClip) const {
- GrResourceProvider* resourceProvider = context->resourceProvider();
+ GrProxyProvider* proxyProvider = context->contextPriv().proxyProvider();
GrUniqueKey key;
create_clip_mask_key(reducedClip.maskGenID(), reducedClip.scissor(),
reducedClip.numAnalyticFPs(), &key);
- sk_sp<GrTextureProxy> proxy(resourceProvider->findOrCreateProxyByUniqueKey(
+ sk_sp<GrTextureProxy> proxy(proxyProvider->findOrCreateProxyByUniqueKey(
key, kBottomLeft_GrSurfaceOrigin));
if (proxy) {
return proxy;
@@ -355,7 +355,7 @@ sk_sp<GrTextureProxy> GrClipStackClip::createAlphaClipMask(GrContext* context,
}
SkASSERT(result->origin() == kBottomLeft_GrSurfaceOrigin);
- resourceProvider->assignUniqueKeyToProxy(key, result.get());
+ proxyProvider->assignUniqueKeyToProxy(key, result.get());
add_invalidate_on_pop_message(*fStack, reducedClip.maskGenID(), key);
return result;
@@ -442,7 +442,9 @@ sk_sp<GrTextureProxy> GrClipStackClip::createSoftwareClipMask(
create_clip_mask_key(reducedClip.maskGenID(), reducedClip.scissor(),
reducedClip.numAnalyticFPs(), &key);
- sk_sp<GrTextureProxy> proxy(context->resourceProvider()->findOrCreateProxyByUniqueKey(
+ GrProxyProvider* proxyProvider = context->contextPriv().proxyProvider();
+
+ sk_sp<GrTextureProxy> proxy(proxyProvider->findOrCreateProxyByUniqueKey(
key, kTopLeft_GrSurfaceOrigin));
if (proxy) {
return proxy;
@@ -462,7 +464,7 @@ sk_sp<GrTextureProxy> GrClipStackClip::createSoftwareClipMask(
desc.fConfig = kAlpha_8_GrPixelConfig;
// MDB TODO: We're going to fill this proxy with an ASAP upload (which is out of order wrt
// to ops), so it can't have any pending IO.
- proxy = GrSurfaceProxy::MakeDeferred(context->resourceProvider(), desc,
+ proxy = GrSurfaceProxy::MakeDeferred(proxyProvider, desc,
SkBackingFit::kApprox, SkBudgeted::kYes,
GrResourceProvider::kNoPendingIO_Flag);
@@ -496,7 +498,7 @@ sk_sp<GrTextureProxy> GrClipStackClip::createSoftwareClipMask(
}
SkASSERT(proxy->origin() == kTopLeft_GrSurfaceOrigin);
- context->resourceProvider()->assignUniqueKeyToProxy(key, proxy.get());
+ proxyProvider->assignUniqueKeyToProxy(key, proxy.get());
add_invalidate_on_pop_message(*fStack, reducedClip.maskGenID(), key);
return proxy;
}