Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(846)

Unified Diff: src/gpu/SkGrPixelRef.cpp

Issue 2069173002: Lots of progress switching to SkColorSpace rather than SkColorProfileType (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix bad assert Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/SkGr.cpp ('k') | src/image/SkImage_Gpu.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)) {
« no previous file with comments | « src/gpu/SkGr.cpp ('k') | src/image/SkImage_Gpu.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698