Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(232)

Unified Diff: src/gpu/GrClipMaskManager.cpp

Issue 1400343004: Fix clipping when all analytic FP creations can be skipped (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix speeling Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrClipMaskManager.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrClipMaskManager.cpp
diff --git a/src/gpu/GrClipMaskManager.cpp b/src/gpu/GrClipMaskManager.cpp
index 882f6073cbe1ab2650c50252a67becddd1d9614e..4b464bb01469101d781811d9a3a4f1391d54db91 100644
--- a/src/gpu/GrClipMaskManager.cpp
+++ b/src/gpu/GrClipMaskManager.cpp
@@ -108,10 +108,10 @@ bool GrClipMaskManager::useSWOnlyPath(const GrPipelineBuilder& pipelineBuilder,
return false;
}
-const GrFragmentProcessor* GrClipMaskManager::getAnalyticClipProcessor(
- const GrReducedClip::ElementList& elements,
- const SkVector& clipToRTOffset,
- const SkRect* drawBounds) {
+bool GrClipMaskManager::getAnalyticClipProcessor(const GrReducedClip::ElementList& elements,
+ SkVector& clipToRTOffset,
+ const SkRect* drawBounds,
+ const GrFragmentProcessor** resultFP) {
SkRect boundsInClipSpace;
if (drawBounds) {
boundsInClipSpace = *drawBounds;
@@ -190,14 +190,14 @@ const GrFragmentProcessor* GrClipMaskManager::getAnalyticClipProcessor(
iter.next();
}
- const GrFragmentProcessor* resultFP = nullptr;
- if (!failed) {
- resultFP = GrFragmentProcessor::RunInSeries(fps, fpCnt);
+ *resultFP = nullptr;
+ if (!failed && fpCnt) {
+ *resultFP = GrFragmentProcessor::RunInSeries(fps, fpCnt);
}
for (int i = 0; i < fpCnt; ++i) {
fps[i]->unref();
}
- return resultFP;
+ return !failed;
}
////////////////////////////////////////////////////////////////////////////////
@@ -283,7 +283,7 @@ bool GrClipMaskManager::setupClipping(const GrPipelineBuilder& pipelineBuilder,
const GrFragmentProcessor* clipFP = nullptr;
if (elements.isEmpty() ||
(requiresAA && !disallowAnalyticAA &&
- SkToBool(clipFP = this->getAnalyticClipProcessor(elements, clipToRTOffset, devBounds)))) {
+ this->getAnalyticClipProcessor(elements, clipToRTOffset, devBounds, &clipFP))) {
SkIRect scissorSpaceIBounds(clipSpaceIBounds);
scissorSpaceIBounds.offset(-clip.origin());
if (nullptr == devBounds ||
« no previous file with comments | « src/gpu/GrClipMaskManager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698