aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrContext.cpp
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2018-01-31 09:29:48 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-01-31 21:15:45 +0000
commitd5f9cdd4b3a6ab0e49bb1a56f2e52e2f40edd0fa (patch)
tree6dce4e0c8b1d00eaef4514cb426790a0d75c73c2 /src/gpu/GrContext.cpp
parent9c17391cef1b0903a3240a50557e20fe68a7f42d (diff)
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 <egdaniel@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/GrContext.cpp')
-rw-r--r--src/gpu/GrContext.cpp18
1 files changed, 14 insertions, 4 deletions
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<GrSurfaceContext> GrContextPriv::makeWrappedSurfaceContext(sk_sp<GrSurfaceProxy> proxy,
- sk_sp<SkColorSpace> colorSpace) {
+ sk_sp<SkColorSpace> 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<GrSurfaceContext> GrContextPriv::makeDeferredSurfaceContext(const GrSurfac
return nullptr;
}
- return this->makeWrappedSurfaceContext(std::move(proxy), nullptr);
+ return this->makeWrappedSurfaceContext(std::move(proxy));
}
sk_sp<GrTextureContext> 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: