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

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: windows warning 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
Index: src/gpu/GrPipelineBuilder.h
diff --git a/src/gpu/GrPipelineBuilder.h b/src/gpu/GrPipelineBuilder.h
index ad509e14f8a57cb1e3203661daeec2b80b5024c6..a8e43221da17b38d0377674483de98e76971713e 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*);
/// @}
@@ -305,15 +306,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); }
@@ -401,6 +397,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.
@@ -448,6 +448,7 @@ private:
mutable SkAutoTUnref<const GrXPFactory> fXPFactory;
FragmentStageArray fColorStages;
FragmentStageArray fCoverageStages;
+ GrClip fClip;
mutable GrProcOptInfo fColorProcInfo;
mutable GrProcOptInfo fCoverageProcInfo;

Powered by Google App Engine
This is Rietveld 408576698