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

Unified Diff: src/gpu/GrContext.cpp

Issue 1407883004: Remove GrPipelineBuilder from getPathRenderer call (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Hide GrContext::drawingManager entry point 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.cpp ('k') | src/gpu/GrDrawContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrContext.cpp
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index 04e1b8d20337301f8046284497c1936aade2874c..755b0f2ec9d8bc8353542c88ea65f5ff6082229a 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -60,8 +60,6 @@ GrContext::GrContext() : fUniqueID(next_id()) {
fCaps = nullptr;
fResourceCache = nullptr;
fResourceProvider = nullptr;
- fPathRendererChain = nullptr;
- fSoftwarePathRenderer = nullptr;
fBatchFontCache = nullptr;
fFlushToReduceCacheSize = false;
}
@@ -118,8 +116,6 @@ GrContext::~GrContext() {
fGpu->unref();
fCaps->unref();
- SkSafeUnref(fPathRendererChain);
- SkSafeUnref(fSoftwarePathRenderer);
}
void GrContext::abandonContext() {
@@ -130,11 +126,6 @@ void GrContext::abandonContext() {
fGpu->contextAbandoned();
- // a path renderer may be holding onto resources that
- // are now unusable
- SkSafeSetNull(fPathRendererChain);
- SkSafeSetNull(fSoftwarePathRenderer);
-
fDrawingManager->abandon();
fBatchFontCache->freeAll();
@@ -151,9 +142,8 @@ void GrContext::freeGpuResources() {
fBatchFontCache->freeAll();
fLayerCache->freeAll();
- // a path renderer may be holding onto resources
- SkSafeSetNull(fPathRendererChain);
- SkSafeSetNull(fSoftwarePathRenderer);
+
+ fDrawingManager->freeGpuResources();
fResourceCache->purgeAllUnlocked();
}
@@ -535,42 +525,6 @@ void GrContext::flushSurfaceWrites(GrSurface* surface) {
}
}
-/*
- * This method finds a path renderer that can draw the specified path on
- * the provided target.
- * Due to its expense, the software path renderer has split out so it can
- * can be individually allowed/disallowed via the "allowSW" boolean.
- */
-GrPathRenderer* GrContext::getPathRenderer(const GrPipelineBuilder& pipelineBuilder,
- const SkMatrix& viewMatrix,
- const SkPath& path,
- const GrStrokeInfo& stroke,
- bool allowSW,
- GrPathRendererChain::DrawType drawType,
- GrPathRendererChain::StencilSupport* stencilSupport) {
-
- if (!fPathRendererChain) {
- fPathRendererChain = new GrPathRendererChain(this);
- }
-
- GrPathRenderer* pr = fPathRendererChain->getPathRenderer(this->caps()->shaderCaps(),
- pipelineBuilder,
- viewMatrix,
- path,
- stroke,
- drawType,
- stencilSupport);
-
- if (!pr && allowSW) {
- if (!fSoftwarePathRenderer) {
- fSoftwarePathRenderer = new GrSoftwarePathRenderer(this);
- }
- pr = fSoftwarePathRenderer;
- }
-
- return pr;
-}
-
////////////////////////////////////////////////////////////////////////////////
int GrContext::getRecommendedSampleCount(GrPixelConfig config,
SkScalar dpi) const {
« no previous file with comments | « src/gpu/GrClipMaskManager.cpp ('k') | src/gpu/GrDrawContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698