Minor Ganesh refFoo cleanup

Change-Id: I2c66693c280225795a5d36ccc0391fcd4056420d
Reviewed-on: https://skia-review.googlesource.com/6995
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This commit is contained in:
Robert Phillips 2017-01-13 11:21:36 -05:00 committed by Skia Commit-Bot
parent f809c1ec98
commit 70b49fd063
3 changed files with 7 additions and 6 deletions

View File

@ -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<SkColorSpace> refColorSpace() const { return fInfo.refColorSpace(); }
/**
* Return the number of bytes per pixel based on the colortype. If the colortype is

View File

@ -166,7 +166,7 @@ sk_sp<GrRenderTargetContext> 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<SkSpecialImage> 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<SkSpecialImage> 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<SkSpecialImage> 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<SkSpecialImage> SkGpuDevice::snapSpecial() {
srcRect,
kNeedNewImageUniqueID_SpecialImage,
sProxy,
sk_ref_sp(ii.colorSpace()),
ii.refColorSpace(),
&this->surfaceProps());
}

View File

@ -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);