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

Unified Diff: src/gpu/GrPipelineBuilder.h

Issue 947443003: Move clip off of draw target (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: feedback inc Created 5 years, 10 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/GrDrawTarget.cpp ('k') | src/gpu/GrPipelineBuilder.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrPipelineBuilder.h
diff --git a/src/gpu/GrPipelineBuilder.h b/src/gpu/GrPipelineBuilder.h
index 904d38250c6732a5aab8d73219ac4688edfd2adb..54b06dbd4fc2183460e03ce4a049fbd45d21cb98 100644
--- a/src/gpu/GrPipelineBuilder.h
+++ b/src/gpu/GrPipelineBuilder.h
@@ -10,6 +10,7 @@
#include "GrBatch.h"
#include "GrBlend.h"
+#include "GrClip.h"
#include "GrDrawTargetCaps.h"
#include "GrGpuResourceRef.h"
#include "GrFragmentStage.h"
@@ -44,7 +45,7 @@ public:
* no GrPaint equivalents are set to default values with the exception of vertex attribute state
* which is unmodified by this function and clipping which will be enabled.
*/
- void setFromPaint(const GrPaint&, GrRenderTarget*);
+ void setFromPaint(const GrPaint&, GrRenderTarget*, const GrClip*);
/// @}
@@ -293,15 +294,10 @@ public:
* the 3D API.
*/
kHWAntialias_StateBit = 0x02,
- /**
- * Draws will respect the clip, otherwise the clip is ignored.
- */
- kClip_StateBit = 0x04,
- kLast_StateBit = kClip_StateBit,
+ kLast_StateBit = kHWAntialias_StateBit,
};
- bool isClipState() const { return 0 != (fFlagBits & kClip_StateBit); }
bool isDither() const { return 0 != (fFlagBits & kDither_StateBit); }
bool isHWAntialias() const { return 0 != (fFlagBits & kHWAntialias_StateBit); }
@@ -389,6 +385,10 @@ public:
this->calcCoverageInvariantOutput(batch);
return fCoverageProcInfo;
}
+
+ void setClip(const GrClip& clip) { fClip = clip; }
+ const GrClip& clip() const { return fClip; }
+
private:
// Calculating invariant color / coverage information is expensive, so we partially cache the
// results.
@@ -436,6 +436,7 @@ private:
mutable SkAutoTUnref<const GrXPFactory> fXPFactory;
FragmentStageArray fColorStages;
FragmentStageArray fCoverageStages;
+ GrClip fClip;
mutable GrProcOptInfo fColorProcInfo;
mutable GrProcOptInfo fCoverageProcInfo;
« no previous file with comments | « src/gpu/GrDrawTarget.cpp ('k') | src/gpu/GrPipelineBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698