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

Unified Diff: src/core/SkBitmap.cpp

Issue 323283002: switch to colortype for deepcopy (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 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
Index: src/core/SkBitmap.cpp
diff --git a/src/core/SkBitmap.cpp b/src/core/SkBitmap.cpp
index ab7a5113022ec1515ce96066bdd97d7a7081aabd..dcbba9afb080976c77162628bdd7d7bfc8f5a84f 100644
--- a/src/core/SkBitmap.cpp
+++ b/src/core/SkBitmap.cpp
@@ -830,7 +830,7 @@ bool SkBitmap::extractSubset(SkBitmap* result, const SkIRect& subset) const {
if (fPixelRef->getTexture() != NULL) {
// Do a deep copy
- SkPixelRef* pixelRef = fPixelRef->deepCopy(this->config(), &subset);
+ SkPixelRef* pixelRef = fPixelRef->deepCopy(this->colorType(), &subset);
if (pixelRef != NULL) {
SkBitmap dst;
dst.setInfo(SkImageInfo::Make(subset.width(), subset.height(),
@@ -1031,8 +1031,7 @@ bool SkBitmap::copyTo(SkBitmap* dst, SkColorType dstColorType,
}
bool SkBitmap::deepCopyTo(SkBitmap* dst) const {
- const SkBitmap::Config dstConfig = this->config();
- const SkColorType dstCT = SkBitmapConfigToColorType(dstConfig);
+ const SkColorType dstCT = this->colorType();
if (!this->canCopyTo(dstCT)) {
return false;
@@ -1041,7 +1040,7 @@ bool SkBitmap::deepCopyTo(SkBitmap* dst) const {
// If we have a PixelRef, and it supports deep copy, use it.
// Currently supported only by texture-backed bitmaps.
if (fPixelRef) {
- SkPixelRef* pixelRef = fPixelRef->deepCopy(dstConfig);
+ SkPixelRef* pixelRef = fPixelRef->deepCopy(dstCT, NULL);
if (pixelRef) {
uint32_t rowBytes;
if (this->colorType() == dstCT) {

Powered by Google App Engine
This is Rietveld 408576698