aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2017-06-01 10:22:03 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-06-01 14:47:31 +0000
commitfe50d9696a95717b994528cdfb99e433348c5ef3 (patch)
tree487d8871660aaf50eda4c774310deebefee2d324 /src
parenteb0e60f1ec2498f5cdba96708f25bd7929201aff (diff)
Remove GrSurface-based surfaceContext factories from GrContextPriv
This relies on both: https://skia-review.googlesource.com/c/13001/ (Rm makeRenderTargetContext in favor of deferred version) https://skia-review.googlesource.com/c/11125/ (Remove discard from GrRenderTarget & force it to always go through a RenderTargetContext) Change-Id: Ia06469a6fa0048e162fb769ed4a11e4773cfacca Reviewed-on: https://skia-review.googlesource.com/13130 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src')
-rw-r--r--src/gpu/GrContext.cpp28
-rw-r--r--src/gpu/GrContextPriv.h8
-rw-r--r--src/gpu/GrResourceProvider.cpp13
3 files changed, 8 insertions, 41 deletions
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index e78dc6ab12..af335dfd57 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -613,22 +613,6 @@ int GrContext::getRecommendedSampleCount(GrPixelConfig config,
return chosenSampleCount <= fGpu->caps()->maxSampleCount() ? chosenSampleCount : 0;
}
-sk_sp<GrRenderTargetContext> GrContextPriv::makeWrappedRenderTargetContext(
- sk_sp<GrRenderTarget> rt,
- sk_sp<SkColorSpace> colorSpace,
- const SkSurfaceProps* surfaceProps) {
- ASSERT_SINGLE_OWNER_PRIV
-
- sk_sp<GrSurfaceProxy> proxy(GrSurfaceProxy::MakeWrapped(std::move(rt)));
- if (!proxy) {
- return nullptr;
- }
-
- return this->drawingManager()->makeRenderTargetContext(std::move(proxy),
- std::move(colorSpace),
- surfaceProps);
-}
-
sk_sp<GrSurfaceContext> GrContextPriv::makeWrappedSurfaceContext(sk_sp<GrSurfaceProxy> proxy,
sk_sp<SkColorSpace> colorSpace) {
ASSERT_SINGLE_OWNER_PRIV
@@ -642,17 +626,6 @@ sk_sp<GrSurfaceContext> GrContextPriv::makeWrappedSurfaceContext(sk_sp<GrSurface
}
}
-sk_sp<GrSurfaceContext> GrContextPriv::makeWrappedSurfaceContext(sk_sp<GrSurface> surface) {
- ASSERT_SINGLE_OWNER_PRIV
-
- sk_sp<GrSurfaceProxy> proxy(GrSurfaceProxy::MakeWrapped(std::move(surface)));
- if (!proxy) {
- return nullptr;
- }
-
- return this->makeWrappedSurfaceContext(std::move(proxy), nullptr);
-}
-
sk_sp<GrSurfaceContext> GrContextPriv::makeDeferredSurfaceContext(const GrSurfaceDesc& dstDesc,
SkBackingFit fit,
SkBudgeted isDstBudgeted) {
@@ -827,7 +800,6 @@ sk_sp<GrRenderTargetContext> GrContext::makeDeferredRenderTargetContext(
fDrawingManager->makeRenderTargetContext(std::move(rtp),
std::move(colorSpace),
surfaceProps));
-
if (!renderTargetContext) {
return nullptr;
}
diff --git a/src/gpu/GrContextPriv.h b/src/gpu/GrContextPriv.h
index c5f592b875..a043b64598 100644
--- a/src/gpu/GrContextPriv.h
+++ b/src/gpu/GrContextPriv.h
@@ -23,14 +23,6 @@ class GrContextPriv {
public:
GrDrawingManager* drawingManager() { return fContext->fDrawingManager.get(); }
- // Create a renderTargetContext that wraps an existing renderTarget
- sk_sp<GrRenderTargetContext> makeWrappedRenderTargetContext(sk_sp<GrRenderTarget>,
- sk_sp<SkColorSpace>,
- const SkSurfaceProps* = nullptr);
-
- // Create a surfaceContext that wraps an existing texture or renderTarget
- sk_sp<GrSurfaceContext> makeWrappedSurfaceContext(sk_sp<GrSurface>);
-
sk_sp<GrSurfaceContext> makeWrappedSurfaceContext(sk_sp<GrSurfaceProxy>, sk_sp<SkColorSpace>);
sk_sp<GrSurfaceContext> makeDeferredSurfaceContext(const GrSurfaceDesc&,
diff --git a/src/gpu/GrResourceProvider.cpp b/src/gpu/GrResourceProvider.cpp
index 128ef7598d..53b9b46d87 100644
--- a/src/gpu/GrResourceProvider.cpp
+++ b/src/gpu/GrResourceProvider.cpp
@@ -161,11 +161,14 @@ sk_sp<GrTextureProxy> GrResourceProvider::createTextureProxy(const GrSurfaceDesc
if (make_info(desc.fWidth, desc.fHeight, desc.fConfig, &srcInfo)) {
sk_sp<GrTexture> tex = this->getExactScratch(desc, budgeted, 0);
- sk_sp<GrSurfaceContext> sContext =
- context->contextPriv().makeWrappedSurfaceContext(std::move(tex));
- if (sContext) {
- if (sContext->writePixels(srcInfo, mipLevel.fPixels, mipLevel.fRowBytes, 0, 0)) {
- return sContext->asTextureProxyRef();
+ sk_sp<GrTextureProxy> proxy = GrSurfaceProxy::MakeWrapped(std::move(tex));
+ if (proxy) {
+ sk_sp<GrSurfaceContext> sContext =
+ context->contextPriv().makeWrappedSurfaceContext(std::move(proxy), nullptr);
+ if (sContext) {
+ if (sContext->writePixels(srcInfo, mipLevel.fPixels, mipLevel.fRowBytes, 0, 0)) {
+ return sContext->asTextureProxyRef();
+ }
}
}
}