From 70b49fd063171a78d3c664ca8af3988f5426319b Mon Sep 17 00:00:00 2001 From: Robert Phillips Date: Fri, 13 Jan 2017 11:21:36 -0500 Subject: [PATCH] Minor Ganesh refFoo cleanup Change-Id: I2c66693c280225795a5d36ccc0391fcd4056420d Reviewed-on: https://skia-review.googlesource.com/6995 Reviewed-by: Mike Reed Commit-Queue: Robert Phillips --- include/core/SkBitmap.h | 1 + src/gpu/SkGpuDevice.cpp | 10 +++++----- src/gpu/SkGr.cpp | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/include/core/SkBitmap.h b/include/core/SkBitmap.h index 4d2af43..08faaaf 100644 --- a/include/core/SkBitmap.h +++ b/include/core/SkBitmap.h @@ -85,6 +85,7 @@ public: SkColorType colorType() const { return fInfo.colorType(); } SkAlphaType alphaType() const { return fInfo.alphaType(); } SkColorSpace* colorSpace() const { return fInfo.colorSpace(); } + sk_sp refColorSpace() const { return fInfo.refColorSpace(); } /** * Return the number of bytes per pixel based on the colortype. If the colortype is diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp index f25c472..bf9341f 100644 --- a/src/gpu/SkGpuDevice.cpp +++ b/src/gpu/SkGpuDevice.cpp @@ -166,7 +166,7 @@ sk_sp SkGpuDevice::MakeRenderTargetContext( GrPixelConfig config = SkImageInfo2GrPixelConfig(origInfo, *context->caps()); return context->makeRenderTargetContext(SkBackingFit::kExact, // Why exact? origInfo.width(), origInfo.height(), - config, sk_ref_sp(origInfo.colorSpace()), sampleCount, + config, origInfo.refColorSpace(), sampleCount, origin, surfaceProps, budgeted); } @@ -1128,7 +1128,7 @@ void SkGpuDevice::drawSprite(const SkDraw& draw, const SkBitmap& bitmap, sk_sp srcImg(SkSpecialImage::MakeFromGpu(srcRect, bitmap.getGenerationID(), std::move(texture), - sk_ref_sp(bitmap.colorSpace()), + bitmap.refColorSpace(), &this->surfaceProps())); this->drawSpecial(draw, srcImg.get(), left, top, paint); @@ -1291,7 +1291,7 @@ sk_sp SkGpuDevice::makeSpecial(const SkBitmap& bitmap) { return SkSpecialImage::MakeFromGpu(bitmap.bounds(), bitmap.getGenerationID(), texture, - sk_ref_sp(bitmap.colorSpace()), + bitmap.refColorSpace(), &this->surfaceProps()); } @@ -1303,7 +1303,7 @@ sk_sp SkGpuDevice::makeSpecial(const SkImage* image) { return SkSpecialImage::MakeFromGpu(SkIRect::MakeWH(image->width(), image->height()), image->uniqueID(), sk_ref_sp(texture), - sk_ref_sp(as_IB(image)->onImageInfo().colorSpace()), + as_IB(image)->onImageInfo().refColorSpace(), &this->surfaceProps()); } else if (image->peekPixels(&pm)) { SkBitmap bm; @@ -1336,7 +1336,7 @@ sk_sp SkGpuDevice::snapSpecial() { srcRect, kNeedNewImageUniqueID_SpecialImage, sProxy, - sk_ref_sp(ii.colorSpace()), + ii.refColorSpace(), &this->surfaceProps()); } diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp index eec3cd7..f3b9008 100644 --- a/src/gpu/SkGr.cpp +++ b/src/gpu/SkGr.cpp @@ -188,7 +188,7 @@ GrTexture* GrUploadPixmapToTexture(GrContext* ctx, const SkPixmap& pixmap, SkBud SkImageInfo dstInfo = SkImageInfo::Make(pixmap.width(), pixmap.height(), kN32_SkColorType, kPremul_SkAlphaType, - sk_ref_sp(pixmap.info().colorSpace())); + pixmap.info().refColorSpace()); tmpBitmap.allocPixels(dstInfo); -- 2.7.4