From d5f9cdd4b3a6ab0e49bb1a56f2e52e2f40edd0fa Mon Sep 17 00:00:00 2001 From: Robert Phillips Date: Wed, 31 Jan 2018 09:29:48 -0500 Subject: Add SkSurface_Gpu::MakeWrappedRenderTarget method This is pulled out of https://skia-review.googlesource.com/c/skia/+/101480 (Implement GPU/OpList DDLs) Change-Id: I12b1ac346c7c1fa10f2120bc92bee63c93fc2249 Reviewed-on: https://skia-review.googlesource.com/102101 Reviewed-by: Greg Daniel Commit-Queue: Robert Phillips --- src/gpu/GrContext.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'src/gpu/GrContext.cpp') diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp index 66cc8b8f6e..0d7705dea3 100644 --- a/src/gpu/GrContext.cpp +++ b/src/gpu/GrContext.cpp @@ -25,7 +25,9 @@ #include "GrTexture.h" #include "GrTextureContext.h" #include "GrTracing.h" + #include "SkConvertPixels.h" +#include "SkDeferredDisplayList.h" #include "SkGr.h" #include "SkJSONWriter.h" #include "SkMakeUnique.h" @@ -263,6 +265,13 @@ bool GrContext::init(const GrContextOptions& options) { prcOptions.fGpuPathRenderers &= ~GpuPathRenderers::kSmall; } + if (!fResourceCache) { + // DDL TODO: remove this crippling of the path renderer chain + // Disable the small path renderer bc of the proxies in the atlas. They need to be + // unified when the opLists are added back to the destination drawing manager. + prcOptions.fGpuPathRenderers &= ~GpuPathRenderers::kSmall; + } + GrAtlasTextContext::Options atlasTextContextOptions; atlasTextContextOptions.fMaxDistanceFieldFontSize = options.fGlyphsAsPathsFontSize; atlasTextContextOptions.fMinDistanceFieldFontSize = options.fMinDistanceFieldFontSize; @@ -800,14 +809,16 @@ void GrContextPriv::flushSurfaceIO(GrSurfaceProxy* proxy) { //////////////////////////////////////////////////////////////////////////////// sk_sp GrContextPriv::makeWrappedSurfaceContext(sk_sp proxy, - sk_sp colorSpace) { + sk_sp colorSpace, + const SkSurfaceProps* props) { ASSERT_SINGLE_OWNER_PRIV if (proxy->asRenderTargetProxy()) { return this->drawingManager()->makeRenderTargetContext(std::move(proxy), - std::move(colorSpace), nullptr); + std::move(colorSpace), props); } else { SkASSERT(proxy->asTextureProxy()); + SkASSERT(!props); return this->drawingManager()->makeTextureContext(std::move(proxy), std::move(colorSpace)); } } @@ -828,7 +839,7 @@ sk_sp GrContextPriv::makeDeferredSurfaceContext(const GrSurfac return nullptr; } - return this->makeWrappedSurfaceContext(std::move(proxy), nullptr); + return this->makeWrappedSurfaceContext(std::move(proxy)); } sk_sp GrContextPriv::makeBackendTextureContext(const GrBackendTexture& tex, @@ -903,7 +914,6 @@ void GrContextPriv::addOnFlushCallbackObject(GrOnFlushCallbackObject* onFlushCBO fContext->fDrawingManager->addOnFlushCallbackObject(onFlushCBObject); } - static inline GrPixelConfig GrPixelConfigFallback(GrPixelConfig config) { switch (config) { case kAlpha_8_GrPixelConfig: -- cgit v1.2.3