aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/SkGr.cpp
diff options
context:
space:
mode:
authorGravatar Matt Sarett <msarett@google.com>2017-04-10 11:03:27 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-04-10 20:10:33 +0000
commit84c9cb7bd8f4c2b0cd4a378995ebbd8524efa390 (patch)
tree46b6875d665f3e0f9830b4b654a94123fe39a555 /src/gpu/SkGr.cpp
parent891dde5b6f0d5110f0ea2d8fe516f7ce9c67fed5 (diff)
getDeferredTextureImageData(): preserve color space in legacy mode
Bug: skia: Change-Id: Ib205f6104827b734635df6932d6dcfdc2248d091 Reviewed-on: https://skia-review.googlesource.com/12103 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Matt Sarett <msarett@google.com>
Diffstat (limited to 'src/gpu/SkGr.cpp')
-rw-r--r--src/gpu/SkGr.cpp20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp
index 5f21e1d479..84be09e357 100644
--- a/src/gpu/SkGr.cpp
+++ b/src/gpu/SkGr.cpp
@@ -158,13 +158,9 @@ static const SkPixmap* compute_desc(const GrCaps& caps, const SkPixmap& pixmap,
return pmap;
}
-sk_sp<GrTextureProxy> GrUploadPixmapToTextureProxy(GrResourceProvider* resourceProvider,
- const SkPixmap& pixmap,
- SkBudgeted budgeted) {
- if (!SkImageInfoIsValid(pixmap.info())) {
- return nullptr;
- }
-
+sk_sp<GrTextureProxy> GrUploadPixmapToTextureProxyNoCheck(GrResourceProvider* resourceProvider,
+ const SkPixmap& pixmap,
+ SkBudgeted budgeted) {
SkBitmap tmpBitmap;
SkPixmap tmpPixmap;
GrSurfaceDesc desc;
@@ -178,6 +174,16 @@ sk_sp<GrTextureProxy> GrUploadPixmapToTextureProxy(GrResourceProvider* resourceP
return nullptr;
}
+sk_sp<GrTextureProxy> GrUploadPixmapToTextureProxy(GrResourceProvider* resourceProvider,
+ const SkPixmap& pixmap,
+ SkBudgeted budgeted) {
+ if (!SkImageInfoIsValid(pixmap.info())) {
+ return nullptr;
+ }
+
+ return GrUploadPixmapToTextureProxyNoCheck(resourceProvider, pixmap, budgeted);
+}
+
////////////////////////////////////////////////////////////////////////////////
void GrInstallBitmapUniqueKeyInvalidator(const GrUniqueKey& key, SkPixelRef* pixelRef) {