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

Unified Diff: src/gpu/GrPathRendererChain.cpp

Issue 1416113006: Minor cleanup of clip mask manager (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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/GrPathRendererChain.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrPathRendererChain.cpp
diff --git a/src/gpu/GrPathRendererChain.cpp b/src/gpu/GrPathRendererChain.cpp
index 63195c641488808812114ea5a8ffe8212ba2dda8..e13e6c658488c4b2aa3243c98f290765c187a130 100644
--- a/src/gpu/GrPathRendererChain.cpp
+++ b/src/gpu/GrPathRendererChain.cpp
@@ -22,9 +22,21 @@
#include "batches/GrStencilAndCoverPathRenderer.h"
#include "batches/GrTessellatingPathRenderer.h"
-GrPathRendererChain::GrPathRendererChain(GrContext* context)
- : fInit(false)
- , fOwner(context) {
+GrPathRendererChain::GrPathRendererChain(GrContext* context) {
+ const GrCaps& caps = *context->caps();
+ this->addPathRenderer(new GrDashLinePathRenderer)->unref();
+
+ if (GrPathRenderer* pr = GrStencilAndCoverPathRenderer::Create(context->resourceProvider(),
+ caps)) {
+ this->addPathRenderer(pr)->unref();
+ }
+ this->addPathRenderer(new GrTessellatingPathRenderer)->unref();
+ this->addPathRenderer(new GrAAHairLinePathRenderer)->unref();
+ this->addPathRenderer(new GrAAConvexPathRenderer)->unref();
+ this->addPathRenderer(new GrAALinearizingConvexPathRenderer)->unref();
+ this->addPathRenderer(new GrAADistanceFieldPathRenderer)->unref();
+ this->addPathRenderer(new GrDefaultPathRenderer(caps.twoSidedStencilSupport(),
+ caps.stencilWrapOpsSupport()))->unref();
}
GrPathRendererChain::~GrPathRendererChain() {
@@ -42,10 +54,6 @@ GrPathRenderer* GrPathRendererChain::addPathRenderer(GrPathRenderer* pr) {
GrPathRenderer* GrPathRendererChain::getPathRenderer(const GrPathRenderer::CanDrawPathArgs& args,
DrawType drawType,
GrPathRenderer::StencilSupport* stencilSupport) {
- if (!fInit) {
- this->init();
- }
-
GR_STATIC_ASSERT(GrPathRenderer::kNoSupport_StencilSupport <
GrPathRenderer::kStencilOnly_StencilSupport);
GR_STATIC_ASSERT(GrPathRenderer::kStencilOnly_StencilSupport <
@@ -60,7 +68,6 @@ GrPathRenderer* GrPathRendererChain::getPathRenderer(const GrPathRenderer::CanDr
minStencilSupport = GrPathRenderer::kNoSupport_StencilSupport;
}
-
for (int i = 0; i < fChain.count(); ++i) {
if (fChain[i]->canDrawPath(args)) {
if (GrPathRenderer::kNoSupport_StencilSupport != minStencilSupport) {
@@ -77,22 +84,3 @@ GrPathRenderer* GrPathRendererChain::getPathRenderer(const GrPathRenderer::CanDr
}
return nullptr;
}
-
-void GrPathRendererChain::init() {
- SkASSERT(!fInit);
- const GrCaps& caps = *fOwner->caps();
- this->addPathRenderer(new GrDashLinePathRenderer)->unref();
-
- if (GrPathRenderer* pr = GrStencilAndCoverPathRenderer::Create(fOwner->resourceProvider(),
- caps)) {
- this->addPathRenderer(pr)->unref();
- }
- this->addPathRenderer(new GrTessellatingPathRenderer)->unref();
- this->addPathRenderer(new GrAAHairLinePathRenderer)->unref();
- this->addPathRenderer(new GrAAConvexPathRenderer)->unref();
- this->addPathRenderer(new GrAALinearizingConvexPathRenderer)->unref();
- this->addPathRenderer(new GrAADistanceFieldPathRenderer)->unref();
- this->addPathRenderer(new GrDefaultPathRenderer(caps.twoSidedStencilSupport(),
- caps.stencilWrapOpsSupport()))->unref();
- fInit = true;
-}
« no previous file with comments | « src/gpu/GrPathRendererChain.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698