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

Unified Diff: cc/test/skia_common.cc

Issue 197883017: SkColorType instead of (deprecated) SkBitmap::Config (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address comments from #5 Created 6 years, 9 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
« no previous file with comments | « cc/test/layer_tree_pixel_test.cc ('k') | cc/test/tiled_layer_test_common.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/test/skia_common.cc
diff --git a/cc/test/skia_common.cc b/cc/test/skia_common.cc
index 277a124e51c65c3f41c7e8b1eec6292414747cf3..7d1c3b841aaf148e66db036e2a1a5d2fbec88691 100644
--- a/cc/test/skia_common.cc
+++ b/cc/test/skia_common.cc
@@ -15,26 +15,19 @@ namespace cc {
void DrawPicture(unsigned char* buffer,
const gfx::Rect& layer_rect,
scoped_refptr<Picture> picture) {
+ SkImageInfo info =
+ SkImageInfo::MakeN32Premul(layer_rect.width(), layer_rect.height());
SkBitmap bitmap;
- bitmap.setConfig(SkBitmap::kARGB_8888_Config,
- layer_rect.width(),
- layer_rect.height());
- bitmap.setPixels(buffer);
+ bitmap.installPixels(info, buffer, info.minRowBytes());
SkCanvas canvas(bitmap);
canvas.clipRect(gfx::RectToSkRect(layer_rect));
picture->Raster(&canvas, NULL, layer_rect, 1.0f);
}
void CreateBitmap(const gfx::Size& size, const char* uri, SkBitmap* bitmap) {
- SkImageInfo info = {
- size.width(),
- size.height(),
- kPMColor_SkColorType,
- kPremul_SkAlphaType
- };
+ SkImageInfo info = SkImageInfo::MakeN32Premul(size.width(), size.height());
- bitmap->setConfig(info);
- bitmap->allocPixels();
+ bitmap->allocPixels(info);
bitmap->pixelRef()->setImmutable();
bitmap->pixelRef()->setURI(uri);
}
« no previous file with comments | « cc/test/layer_tree_pixel_test.cc ('k') | cc/test/tiled_layer_test_common.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698