aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrContext.cpp
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2017-04-10 11:10:22 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-04-11 11:36:53 +0000
commitd83ec0441279b79551b4ecb4598696249ea55145 (patch)
treef5027d9a7378204825bfafee4f67e485a7265776 /src/gpu/GrContext.cpp
parent5bd984892db1b5a2c3f76d51d8d77499afd853c5 (diff)
Rm makeRenderTargetContext in favor of deferred version
Change-Id: Ifdf67453607256ba7cdb0837263377bd83907212 Reviewed-on: https://skia-review.googlesource.com/13001 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/GrContext.cpp')
-rw-r--r--src/gpu/GrContext.cpp61
1 files changed, 3 insertions, 58 deletions
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index bfe094df7a..07ae6b226e 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -489,7 +489,7 @@ bool GrContextPriv::readSurfacePixels(GrSurfaceProxy* srcProxy, SkColorSpace* sr
// TODO: Need to decide the semantics of this function for color spaces. Do we support
// conversion to a passed-in color space? For now, specifying nullptr means that this
// path will do no conversion, so it will match the behavior of the non-draw path.
- sk_sp<GrRenderTargetContext> tempRTC = fContext->makeRenderTargetContext(
+ sk_sp<GrRenderTargetContext> tempRTC = fContext->makeDeferredRenderTargetContext(
tempDrawInfo.fTempSurfaceFit,
tempDrawInfo.fTempSurfaceDesc.fWidth,
tempDrawInfo.fTempSurfaceDesc.fHeight,
@@ -776,23 +776,6 @@ static inline GrPixelConfig GrPixelConfigFallback(GrPixelConfig config) {
}
}
-sk_sp<GrRenderTargetContext> GrContext::makeRenderTargetContextWithFallback(
- SkBackingFit fit,
- int width, int height,
- GrPixelConfig config,
- sk_sp<SkColorSpace> colorSpace,
- int sampleCnt,
- GrSurfaceOrigin origin,
- const SkSurfaceProps* surfaceProps,
- SkBudgeted budgeted) {
- if (!this->caps()->isConfigRenderable(config, sampleCnt > 0)) {
- config = GrPixelConfigFallback(config);
- }
-
- return this->makeRenderTargetContext(fit, width, height, config, std::move(colorSpace),
- sampleCnt, origin, surfaceProps, budgeted);
-}
-
sk_sp<GrRenderTargetContext> GrContext::makeDeferredRenderTargetContextWithFallback(
SkBackingFit fit,
int width, int height,
@@ -810,46 +793,6 @@ sk_sp<GrRenderTargetContext> GrContext::makeDeferredRenderTargetContextWithFallb
sampleCnt, origin, surfaceProps, budgeted);
}
-sk_sp<GrRenderTargetContext> GrContext::makeRenderTargetContext(SkBackingFit fit,
- int width, int height,
- GrPixelConfig config,
- sk_sp<SkColorSpace> colorSpace,
- int sampleCnt,
- GrSurfaceOrigin origin,
- const SkSurfaceProps* surfaceProps,
- SkBudgeted budgeted) {
- if (!this->caps()->isConfigRenderable(config, sampleCnt > 0)) {
- return nullptr;
- }
-
- GrSurfaceDesc desc;
- desc.fFlags = kRenderTarget_GrSurfaceFlag;
- desc.fOrigin = origin;
- desc.fWidth = width;
- desc.fHeight = height;
- desc.fConfig = config;
- desc.fSampleCnt = sampleCnt;
-
- sk_sp<GrTexture> tex;
- if (SkBackingFit::kExact == fit) {
- tex = this->resourceProvider()->createTexture(desc, budgeted);
- } else {
- tex.reset(this->resourceProvider()->createApproxTexture(desc, 0));
- }
- if (!tex) {
- return nullptr;
- }
-
- sk_sp<GrRenderTargetContext> renderTargetContext(
- this->contextPriv().makeWrappedRenderTargetContext(sk_ref_sp(tex->asRenderTarget()),
- std::move(colorSpace), surfaceProps));
- if (!renderTargetContext) {
- return nullptr;
- }
-
- return renderTargetContext;
-}
-
sk_sp<GrRenderTargetContext> GrContext::makeDeferredRenderTargetContext(
SkBackingFit fit,
int width, int height,
@@ -859,6 +802,8 @@ sk_sp<GrRenderTargetContext> GrContext::makeDeferredRenderTargetContext(
GrSurfaceOrigin origin,
const SkSurfaceProps* surfaceProps,
SkBudgeted budgeted) {
+ SkASSERT(kDefault_GrSurfaceOrigin != origin);
+
GrSurfaceDesc desc;
desc.fFlags = kRenderTarget_GrSurfaceFlag;
desc.fOrigin = origin;