aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrClipMaskManager.cpp
diff options
context:
space:
mode:
authorGravatar robertphillips <robertphillips@google.com>2016-05-20 06:38:43 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-05-20 06:38:43 -0700
commit0152d731e0be311fda29467086d2c83629601aa1 (patch)
treec447158a2d955c73791d647de1d97d1e04e7732c /src/gpu/GrClipMaskManager.cpp
parent24a9bd711a74450d7c76c504acbadef384293dfc (diff)
GrSWMaskHelper and GrSoftwarePathRenderer only need the textureProvider (not GrContext)
This is split out of: https://codereview.chromium.org/1988923002/ (Declassify GrClipMaskManager and Remove GrRenderTarget and GrDrawTarget from GrPipelineBuilder) BUG=skia: Review-Url: https://codereview.chromium.org/1993403002
Diffstat (limited to 'src/gpu/GrClipMaskManager.cpp')
-rw-r--r--src/gpu/GrClipMaskManager.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/gpu/GrClipMaskManager.cpp b/src/gpu/GrClipMaskManager.cpp
index 81b6fe8614..df58a9251f 100644
--- a/src/gpu/GrClipMaskManager.cpp
+++ b/src/gpu/GrClipMaskManager.cpp
@@ -384,7 +384,7 @@ bool GrClipMaskManager::setupClipping(const GrPipelineBuilder& pipelineBuilder,
if (UseSWOnlyPath(this->getContext(), pipelineBuilder, rt, clipToMaskOffset, elements)) {
// The clip geometry is complex enough that it will be more efficient to create it
// entirely in software
- result = CreateSoftwareClipMask(this->getContext(),
+ result = CreateSoftwareClipMask(this->getContext()->textureProvider(),
genID,
initialState,
elements,
@@ -791,7 +791,7 @@ bool GrClipMaskManager::createStencilClipMask(GrRenderTarget* rt,
////////////////////////////////////////////////////////////////////////////////
sk_sp<GrTexture> GrClipMaskManager::CreateSoftwareClipMask(
- GrContext* context,
+ GrTextureProvider* texProvider,
int32_t elementsGenID,
GrReducedClip::InitialState initialState,
const GrReducedClip::ElementList& elements,
@@ -799,8 +799,7 @@ sk_sp<GrTexture> GrClipMaskManager::CreateSoftwareClipMask(
const SkIRect& clipSpaceIBounds) {
GrUniqueKey key;
GetClipMaskKey(elementsGenID, clipSpaceIBounds, &key);
- GrResourceProvider* resourceProvider = context->resourceProvider();
- if (GrTexture* texture = resourceProvider->findAndRefTextureByUniqueKey(key)) {
+ if (GrTexture* texture = texProvider->findAndRefTextureByUniqueKey(key)) {
return sk_sp<GrTexture>(texture);
}
@@ -808,7 +807,7 @@ sk_sp<GrTexture> GrClipMaskManager::CreateSoftwareClipMask(
// the top left corner of the resulting rect to the top left of the texture.
SkIRect maskSpaceIBounds = SkIRect::MakeWH(clipSpaceIBounds.width(), clipSpaceIBounds.height());
- GrSWMaskHelper helper(context);
+ GrSWMaskHelper helper(texProvider);
// Set the matrix so that rendered clip elements are transformed to mask space from clip
// space.
@@ -857,7 +856,7 @@ sk_sp<GrTexture> GrClipMaskManager::CreateSoftwareClipMask(
desc.fHeight = clipSpaceIBounds.height();
desc.fConfig = kAlpha_8_GrPixelConfig;
- sk_sp<GrTexture> result(context->resourceProvider()->createApproxTexture(desc, 0));
+ sk_sp<GrTexture> result(texProvider->createApproxTexture(desc));
if (!result) {
return nullptr;
}