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

Unified Diff: src/gpu/GrDrawTarget.cpp

Issue 683933003: Clip mask manager moved to ClipTarget (Closed) Base URL: https://skia.googlesource.com/skia.git@clear_stencil_clip_on_drawinfo
Patch Set: cleanup Created 6 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
Index: src/gpu/GrDrawTarget.cpp
diff --git a/src/gpu/GrDrawTarget.cpp b/src/gpu/GrDrawTarget.cpp
index e830145cfbf05257c2663ad94384af8b8d1905a9..ccfc8f700a08ee750cf76a4dc2cd9330b63919c2 100644
--- a/src/gpu/GrDrawTarget.cpp
+++ b/src/gpu/GrDrawTarget.cpp
@@ -93,7 +93,6 @@ GrDrawTarget::GrDrawTarget(GrContext* context)
, fContext(context)
, fGpuTraceMarkerCount(0) {
SkASSERT(context);
-
fDrawState = &fDefaultDrawState;
// We assume that fDrawState always owns a ref to the object it points at.
fDefaultDrawState.ref();
@@ -1159,3 +1158,41 @@ uint32_t GrDrawTargetCaps::CreateUniqueID() {
return id;
}
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+static const GrStencilSettings& winding_path_stencil_settings() {
+ GR_STATIC_CONST_SAME_STENCIL_STRUCT(gSettings,
+ kIncClamp_StencilOp,
+ kIncClamp_StencilOp,
+ kAlwaysIfInClip_StencilFunc,
+ 0xFFFF, 0xFFFF, 0xFFFF);
+ return *GR_CONST_STENCIL_SETTINGS_PTR_FROM_STRUCT_PTR(&gSettings);
+}
+
+static const GrStencilSettings& even_odd_path_stencil_settings() {
+ GR_STATIC_CONST_SAME_STENCIL_STRUCT(gSettings,
+ kInvert_StencilOp,
+ kInvert_StencilOp,
+ kAlwaysIfInClip_StencilFunc,
+ 0xFFFF, 0xFFFF, 0xFFFF);
+ return *GR_CONST_STENCIL_SETTINGS_PTR_FROM_STRUCT_PTR(&gSettings);
+}
+
+void GrClipTarget::getPathStencilSettingsForFillType(SkPath::FillType fill,
+ GrStencilSettings* outStencilSettings) {
+
+ switch (fill) {
+ default:
+ SkFAIL("Unexpected path fill.");
+ /* fallthrough */;
+ case SkPath::kWinding_FillType:
+ case SkPath::kInverseWinding_FillType:
+ *outStencilSettings = winding_path_stencil_settings();
+ break;
+ case SkPath::kEvenOdd_FillType:
+ case SkPath::kInverseEvenOdd_FillType:
+ *outStencilSettings = even_odd_path_stencil_settings();
+ break;
+ }
+ fClipMaskManager.adjustPathStencilParams(outStencilSettings);
+}
« src/gpu/GrDrawTarget.h ('K') | « src/gpu/GrDrawTarget.h ('k') | src/gpu/GrGpu.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698