aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/image/SkSurface_Gpu.cpp
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2018-03-19 14:01:21 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-03-19 18:43:25 +0000
commitcb88470d82d646972a7e83d04bb19444d87dd840 (patch)
treed034fc09d11662ec1e81adf4ade799e9ae41548d /src/image/SkSurface_Gpu.cpp
parentbe5947c2f38a79b7c709accfb1047d8fd06a0227 (diff)
Remove SkSurface::MakeFromBackendTextureAsRenderTarget variant that doesn't take SkColorType
Bug: skia:6718 Change-Id: I3fabe2050394bfbd8ad2fa600d07323838308ae5 Reviewed-on: https://skia-review.googlesource.com/115087 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/image/SkSurface_Gpu.cpp')
-rw-r--r--src/image/SkSurface_Gpu.cpp37
1 files changed, 11 insertions, 26 deletions
diff --git a/src/image/SkSurface_Gpu.cpp b/src/image/SkSurface_Gpu.cpp
index 527c35b16a..c4479a2d24 100644
--- a/src/image/SkSurface_Gpu.cpp
+++ b/src/image/SkSurface_Gpu.cpp
@@ -465,6 +465,7 @@ sk_sp<SkSurface> SkSurface::MakeFromBackendTextureAsRenderTarget(GrContext* cont
const GrBackendTexture& tex,
GrSurfaceOrigin origin,
int sampleCnt,
+ SkColorType colorType,
sk_sp<SkColorSpace> colorSpace,
const SkSurfaceProps* props) {
if (!context) {
@@ -474,14 +475,19 @@ sk_sp<SkSurface> SkSurface::MakeFromBackendTextureAsRenderTarget(GrContext* cont
return nullptr;
}
sampleCnt = SkTMax(1, sampleCnt);
+ GrBackendTexture texCopy = tex;
+ if (!validate_backend_texture(context, texCopy, &texCopy.fConfig,
+ sampleCnt, colorType, colorSpace, false)) {
+ return nullptr;
+ }
sk_sp<GrRenderTargetContext> rtc(
context->contextPriv().makeBackendTextureAsRenderTargetRenderTargetContext(
- tex,
- origin,
- sampleCnt,
- std::move(colorSpace),
- props));
+ texCopy,
+ origin,
+ sampleCnt,
+ std::move(colorSpace),
+ props));
if (!rtc) {
return nullptr;
}
@@ -494,25 +500,4 @@ sk_sp<SkSurface> SkSurface::MakeFromBackendTextureAsRenderTarget(GrContext* cont
return sk_make_sp<SkSurface_Gpu>(std::move(device));
}
-sk_sp<SkSurface> SkSurface::MakeFromBackendTextureAsRenderTarget(GrContext* context,
- const GrBackendTexture& tex,
- GrSurfaceOrigin origin,
- int sampleCnt,
- SkColorType colorType,
- sk_sp<SkColorSpace> colorSpace,
- const SkSurfaceProps* props) {
- if (!context) {
- return nullptr;
- }
- sampleCnt = SkTMax(1, sampleCnt);
- GrBackendTexture texCopy = tex;
- if (!validate_backend_texture(context, texCopy, &texCopy.fConfig,
- sampleCnt, colorType, colorSpace, false)) {
- return nullptr;
- }
-
- return MakeFromBackendTextureAsRenderTarget(context, texCopy, origin, sampleCnt, colorSpace,
- props);
-}
-
#endif