summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorreed@google.com <reed@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-01 13:02:52 +0000
committerreed@google.com <reed@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-01 13:02:52 +0000
commitb2f17e925b2bf0dfdbcc7e518703f3d5795c9622 (patch)
tree2958e6b421e3de2a318ff5ff1e9dafe66b65681e
parent73c5b69dc3c8d77403eaa0e2a3f2617842f05582 (diff)
downloadchromium_src-b2f17e925b2bf0dfdbcc7e518703f3d5795c9622.zip
chromium_src-b2f17e925b2bf0dfdbcc7e518703f3d5795c9622.tar.gz
chromium_src-b2f17e925b2bf0dfdbcc7e518703f3d5795c9622.tar.bz2
setConfig is deprecated, use setInfo or allocPixels instead
kPMColor_SkColorType -> kN32_SkColorType TBR=scherkus@chromium.org,benwells@chromium.org BUG=skia:2706 Review URL: https://codereview.chromium.org/357213002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@280805 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--components/favicon_base/favicon_util.cc5
-rw-r--r--components/favicon_base/select_favicon_frames.cc3
-rw-r--r--extensions/renderer/set_icon_natives.cc3
-rw-r--r--media/filters/skcanvas_video_renderer.cc6
-rw-r--r--media/video/capture/fake_video_capture_device.cc8
-rw-r--r--skia/ext/bitmap_platform_device_mac.cc2
6 files changed, 9 insertions, 18 deletions
diff --git a/components/favicon_base/favicon_util.cc b/components/favicon_base/favicon_util.cc
index 84ead61..54efdf4 100644
--- a/components/favicon_base/favicon_util.cc
+++ b/components/favicon_base/favicon_util.cc
@@ -116,10 +116,7 @@ SkBitmap ResizeBitmapByDownsamplingIfPossible(
// Use nearest neighbour resampling if upsampling by an integer. This
// makes the result look similar to the result of SelectFaviconFrames().
SkBitmap bitmap;
- bitmap.setConfig(SkBitmap::kARGB_8888_Config,
- desired_size_in_pixel,
- desired_size_in_pixel);
- bitmap.allocPixels();
+ bitmap.allocN32Pixels(desired_size_in_pixel, desired_size_in_pixel);
if (!best_bitmap.isOpaque())
bitmap.eraseARGB(0, 0, 0, 0);
diff --git a/components/favicon_base/select_favicon_frames.cc b/components/favicon_base/select_favicon_frames.cc
index 3122365..671d732 100644
--- a/components/favicon_base/select_favicon_frames.cc
+++ b/components/favicon_base/select_favicon_frames.cc
@@ -35,8 +35,7 @@ size_t BiggestCandidate(const std::vector<gfx::Size>& candidate_sizes) {
SkBitmap SampleNearestNeighbor(const SkBitmap& contents, int desired_size) {
SkBitmap bitmap;
- bitmap.setConfig(SkBitmap::kARGB_8888_Config, desired_size, desired_size);
- bitmap.allocPixels();
+ bitmap.allocN32Pixels(desired_size, desired_size);
if (!contents.isOpaque())
bitmap.eraseARGB(0, 0, 0, 0);
diff --git a/extensions/renderer/set_icon_natives.cc b/extensions/renderer/set_icon_natives.cc
index 2ef12dc..192112f 100644
--- a/extensions/renderer/set_icon_natives.cc
+++ b/extensions/renderer/set_icon_natives.cc
@@ -68,8 +68,7 @@ bool SetIconNatives::ConvertImageDataToBitmapValue(
}
SkBitmap bitmap;
- bitmap.setConfig(SkBitmap::kARGB_8888_Config, width, height);
- if (!bitmap.allocPixels()) {
+ if (!bitmap.allocN32Pixels(width, height)) {
isolate->ThrowException(
v8::Exception::Error(v8::String::NewFromUtf8(isolate, kNoMemory)));
return false;
diff --git a/media/filters/skcanvas_video_renderer.cc b/media/filters/skcanvas_video_renderer.cc
index 0f5dd0e..53a9fb9 100644
--- a/media/filters/skcanvas_video_renderer.cc
+++ b/media/filters/skcanvas_video_renderer.cc
@@ -56,10 +56,8 @@ static void ConvertVideoFrameToBitmap(
if (bitmap->isNull() ||
bitmap->width() != video_frame->visible_rect().width() ||
bitmap->height() != video_frame->visible_rect().height()) {
- bitmap->setConfig(SkBitmap::kARGB_8888_Config,
- video_frame->visible_rect().width(),
- video_frame->visible_rect().height());
- bitmap->allocPixels();
+ bitmap->allocN32Pixels(video_frame->visible_rect().width(),
+ video_frame->visible_rect().height());
bitmap->setIsVolatile(true);
}
diff --git a/media/video/capture/fake_video_capture_device.cc b/media/video/capture/fake_video_capture_device.cc
index 302396a..6f4fd75 100644
--- a/media/video/capture/fake_video_capture_device.cc
+++ b/media/video/capture/fake_video_capture_device.cc
@@ -104,12 +104,10 @@ void FakeVideoCaptureDevice::OnCaptureTask() {
VideoFrame::AllocationSize(VideoFrame::I420, capture_format_.frame_size);
memset(fake_frame_.get(), 0, frame_size);
+ SkImageInfo info = SkImageInfo::MakeA8(capture_format_.frame_size.width(),
+ capture_format_.frame_size.height());
SkBitmap bitmap;
- bitmap.setConfig(SkBitmap::kA8_Config,
- capture_format_.frame_size.width(),
- capture_format_.frame_size.height(),
- capture_format_.frame_size.width()),
- bitmap.setPixels(fake_frame_.get());
+ bitmap.installPixels(info, fake_frame_.get(), info.width());
SkCanvas canvas(bitmap);
// Draw a sweeping circle to show an animation.
diff --git a/skia/ext/bitmap_platform_device_mac.cc b/skia/ext/bitmap_platform_device_mac.cc
index f30a405..8cd4920 100644
--- a/skia/ext/bitmap_platform_device_mac.cc
+++ b/skia/ext/bitmap_platform_device_mac.cc
@@ -239,7 +239,7 @@ void BitmapPlatformDevice::DrawToNativeContext(CGContextRef context, int x,
SkBaseDevice* BitmapPlatformDevice::onCreateDevice(const SkImageInfo& info,
Usage /*usage*/) {
- SkASSERT(info.colorType() == kPMColor_SkColorType);
+ SkASSERT(info.colorType() == kN32_SkColorType);
return BitmapPlatformDevice::CreateAndClear(info.width(), info.height(),
info.isOpaque());
}