summaryrefslogtreecommitdiffstats
path: root/skia/ext/image_operations.cc
diff options
context:
space:
mode:
authorreed@google.com <reed@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-24 20:30:35 +0000
committerreed@google.com <reed@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-24 20:30:35 +0000
commita476d6bc629e75337f1052c9c70b3a993afed0e6 (patch)
tree0327947bc5a8345e5d47e47d413c1ae839220858 /skia/ext/image_operations.cc
parent923e85f5dbb8fcea66b4d4a791331b186486ac7d (diff)
downloadchromium_src-a476d6bc629e75337f1052c9c70b3a993afed0e6.zip
chromium_src-a476d6bc629e75337f1052c9c70b3a993afed0e6.tar.gz
chromium_src-a476d6bc629e75337f1052c9c70b3a993afed0e6.tar.bz2
replace setIsOpaque (deprecated) with explicit SkAlphaType
BUG= R=enne@chromium.org, jam@chromium.org, jamesr@chromium.org, thakis@chromium.org Review URL: https://codereview.chromium.org/37233002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@230799 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'skia/ext/image_operations.cc')
-rw-r--r--skia/ext/image_operations.cc10
1 files changed, 3 insertions, 7 deletions
diff --git a/skia/ext/image_operations.cc b/skia/ext/image_operations.cc
index c61da0c..3bb765ff 100644
--- a/skia/ext/image_operations.cc
+++ b/skia/ext/image_operations.cc
@@ -394,7 +394,7 @@ SkBitmap ImageOperations::ResizeSubpixel(const SkBitmap& source,
// Render into subpixels.
SkBitmap result;
result.setConfig(SkBitmap::kARGB_8888_Config, dest_subset.width(),
- dest_subset.height());
+ dest_subset.height(), 0, img.alphaType());
result.allocPixels(allocator, NULL);
if (!result.readyToDraw())
return img;
@@ -455,7 +455,6 @@ SkBitmap ImageOperations::ResizeSubpixel(const SkBitmap& source,
src_row += h * row_words;
dst_row += result.rowBytes() / 4;
}
- result.setIsOpaque(img.isOpaque());
return result;
#else
return SkBitmap();
@@ -510,8 +509,8 @@ SkBitmap ImageOperations::ResizeBasic(const SkBitmap& source,
// Convolve into the result.
SkBitmap result;
- result.setConfig(SkBitmap::kARGB_8888_Config,
- dest_subset.width(), dest_subset.height());
+ result.setConfig(SkBitmap::kARGB_8888_Config, dest_subset.width(),
+ dest_subset.height(), 0, source.alphaType());
result.allocPixels(allocator, NULL);
if (!result.readyToDraw())
return SkBitmap();
@@ -522,9 +521,6 @@ SkBitmap ImageOperations::ResizeBasic(const SkBitmap& source,
static_cast<unsigned char*>(result.getPixels()),
true);
- // Preserve the "opaque" flag for use as an optimization later.
- result.setIsOpaque(source.isOpaque());
-
base::TimeDelta delta = base::TimeTicks::Now() - resize_start;
UMA_HISTOGRAM_TIMES("Image.ResampleMS", delta);