Index: src/gpu/SkGrPixelRef.cpp |
diff --git a/src/gpu/SkGrPixelRef.cpp b/src/gpu/SkGrPixelRef.cpp |
index df720da55119d656521765eaaf8ab0667bb078b0..df2300369d3359a8311a6f86c55422f7704ec795 100644 |
--- a/src/gpu/SkGrPixelRef.cpp |
+++ b/src/gpu/SkGrPixelRef.cpp |
@@ -50,7 +50,7 @@ bool SkROLockPixelsPixelRef::onLockPixelsAreWritable() const { |
/////////////////////////////////////////////////////////////////////////////// |
static SkGrPixelRef* copy_to_new_texture_pixelref(GrTexture* texture, SkColorType dstCT, |
- SkColorProfileType dstPT, const SkIRect* subset) { |
+ SkColorSpace* dstCS, const SkIRect* subset) { |
if (nullptr == texture || kUnknown_SkColorType == dstCT) { |
return nullptr; |
} |
@@ -74,7 +74,7 @@ static SkGrPixelRef* copy_to_new_texture_pixelref(GrTexture* texture, SkColorTyp |
srcRect = *subset; |
} |
desc.fFlags = kRenderTarget_GrSurfaceFlag; |
- desc.fConfig = SkImageInfo2GrPixelConfig(dstCT, kPremul_SkAlphaType, dstPT, *context->caps()); |
+ desc.fConfig = SkImageInfo2GrPixelConfig(dstCT, kPremul_SkAlphaType, dstCS, *context->caps()); |
desc.fIsMipMapped = false; |
GrTexture* dst = context->textureProvider()->createTexture(desc, SkBudgeted::kNo, nullptr, 0); |
@@ -89,7 +89,7 @@ static SkGrPixelRef* copy_to_new_texture_pixelref(GrTexture* texture, SkColorTyp |
context->flushSurfaceWrites(dst); |
SkImageInfo info = SkImageInfo::Make(desc.fWidth, desc.fHeight, dstCT, kPremul_SkAlphaType, |
- dstPT); |
+ sk_ref_sp(dstCS)); |
SkGrPixelRef* pixelRef = new SkGrPixelRef(info, dst); |
SkSafeUnref(dst); |
return pixelRef; |
@@ -130,8 +130,7 @@ void SkGrPixelRef::onNotifyPixelsChanged() { |
} |
} |
-SkPixelRef* SkGrPixelRef::deepCopy(SkColorType dstCT, SkColorProfileType dstPT, |
- const SkIRect* subset) { |
+SkPixelRef* SkGrPixelRef::deepCopy(SkColorType dstCT, SkColorSpace* dstCS, const SkIRect* subset) { |
if (nullptr == fSurface) { |
return nullptr; |
} |
@@ -142,7 +141,7 @@ SkPixelRef* SkGrPixelRef::deepCopy(SkColorType dstCT, SkColorProfileType dstPT, |
// a GrTexture owned elsewhere (e.g., SkGpuDevice), and cannot live |
// independently of that texture. Texture-backed pixel refs, on the other |
// hand, own their GrTextures, and are thus self-contained. |
- return copy_to_new_texture_pixelref(fSurface->asTexture(), dstCT, dstPT, subset); |
+ return copy_to_new_texture_pixelref(fSurface->asTexture(), dstCT, dstCS, subset); |
} |
static bool tryAllocBitmapPixels(SkBitmap* bitmap) { |
@@ -183,7 +182,7 @@ bool SkGrPixelRef::onReadPixels(SkBitmap* dst, SkColorType colorType, const SkIR |
SkBitmap cachedBitmap; |
cachedBitmap.setInfo(SkImageInfo::Make(bounds.width(), bounds.height(), colorType, |
this->info().alphaType(), |
- this->info().profileType())); |
+ sk_ref_sp(this->info().colorSpace()))); |
// If we can't alloc the pixels, then fail |
if (!tryAllocBitmapPixels(&cachedBitmap)) { |