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

Unified Diff: src/gpu/GrDrawingManager.cpp

Issue 1701013002: Create GrPathRenderingDrawContext (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: tweaks Created 4 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/GrDrawingManager.h ('k') | src/gpu/GrPathRenderingDrawContext.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrDrawingManager.cpp
diff --git a/src/gpu/GrDrawingManager.cpp b/src/gpu/GrDrawingManager.cpp
index a063c398edba419de83e0a8eb043cca814d57d25..ca50fe45024e3c26f96d9b4e4209ea64c56552ea 100644
--- a/src/gpu/GrDrawingManager.cpp
+++ b/src/gpu/GrDrawingManager.cpp
@@ -8,6 +8,7 @@
#include "GrDrawContext.h"
#include "GrDrawingManager.h"
#include "GrDrawTarget.h"
+#include "GrPathRenderingDrawContext.h"
#include "GrResourceProvider.h"
#include "GrSoftwarePathRenderer.h"
#include "SkTTopoSort.h"
@@ -28,12 +29,6 @@ void GrDrawingManager::cleanup() {
fDrawTargets.reset();
- delete fNVPRTextContext;
- fNVPRTextContext = nullptr;
-
- delete fAtlasTextContext;
- fAtlasTextContext = nullptr;
-
delete fPathRendererChain;
fPathRendererChain = nullptr;
SkSafeSetNull(fSoftwarePathRenderer);
@@ -114,32 +109,6 @@ void GrDrawingManager::flush() {
fFlushing = false;
}
-GrTextContext* GrDrawingManager::textContext(const SkSurfaceProps& props, GrRenderTarget* rt) {
- if (this->abandoned()) {
- return nullptr;
- }
-
- bool useDIF = props.isUseDeviceIndependentFonts();
-
- if (useDIF && fContext->caps()->shaderCaps()->pathRenderingSupport() &&
- rt->isStencilBufferMultisampled()) {
- GrStencilAttachment* sb = fContext->resourceProvider()->attachStencilAttachment(rt);
- if (sb) {
- if (!fNVPRTextContext) {
- fNVPRTextContext = GrStencilAndCoverTextContext::Create();
- }
-
- return fNVPRTextContext;
- }
- }
-
- if (!fAtlasTextContext) {
- fAtlasTextContext = GrAtlasTextContext::Create();
- }
-
- return fAtlasTextContext;
-}
-
GrDrawTarget* GrDrawingManager::newDrawTarget(GrRenderTarget* rt) {
SkASSERT(fContext);
@@ -196,6 +165,21 @@ GrDrawContext* GrDrawingManager::drawContext(GrRenderTarget* rt,
return nullptr;
}
+
+ bool useDIF = false;
+ if (surfaceProps) {
+ useDIF = surfaceProps->isUseDeviceIndependentFonts();
+ }
+
+ if (useDIF && fContext->caps()->shaderCaps()->pathRenderingSupport() &&
+ rt->isStencilBufferMultisampled()) {
+ GrStencilAttachment* sb = fContext->resourceProvider()->attachStencilAttachment(rt);
+ if (sb) {
+ return new GrPathRenderingDrawContext(fContext, this, rt, surfaceProps,
+ fContext->getAuditTrail(), fSingleOwner);
+ }
+ }
+
return new GrDrawContext(fContext, this, rt, surfaceProps, fContext->getAuditTrail(),
fSingleOwner);
}
« no previous file with comments | « src/gpu/GrDrawingManager.h ('k') | src/gpu/GrPathRenderingDrawContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698