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

Unified Diff: cc/raster/tile_task_worker_pool.cc

Issue 1248253003: Add better support for RGBA_4444 textures. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 4 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: cc/raster/tile_task_worker_pool.cc
diff --git a/cc/raster/tile_task_worker_pool.cc b/cc/raster/tile_task_worker_pool.cc
index f9862fbab1a203c56774038e5a86f0718787630f..6b1eb1e3eeb82d0f0c0309d3c6af111a9bb364b5 100644
--- a/cc/raster/tile_task_worker_pool.cc
+++ b/cc/raster/tile_task_worker_pool.cc
@@ -225,18 +225,22 @@ void TileTaskWorkerPool::PlaybackToMemory(void* memory,
skia::RefPtr<SkCanvas> canvas = skia::SharePtr(surface->getCanvas());
canvas->setDrawFilter(image_filter.get());
raster_source->PlaybackToCanvas(canvas.get(), canvas_bitmap_rect,
- canvas_playback_rect, scale);
-
- SkImageInfo dst_info =
- SkImageInfo::Make(info.width(), info.height(), buffer_color_type,
- info.alphaType(), info.profileType());
- // TODO(kaanb): The GL pipeline assumes a 4-byte alignment for the
- // bitmap data. There will be no need to call SkAlign4 once crbug.com/293728
- // is fixed.
- const size_t dst_row_bytes = SkAlign4(dst_info.minRowBytes());
- DCHECK_EQ(0u, dst_row_bytes % 4);
- bool success = canvas->readPixels(dst_info, memory, dst_row_bytes, 0, 0);
- DCHECK_EQ(true, success);
+ canvas_bitmap_rect, scale);
reveman 2015/08/10 23:19:01 Note: this change is needed to make the code below
danakj 2015/08/10 23:35:54 Can you file a bug and point to it in a TODO sayin
reveman 2015/08/10 23:49:41 Added TODO.
+
+ {
+ TRACE_EVENT0("cc", "TileTaskWorkerPool::PlaybackToMemory::ConvertPixels");
+
+ SkImageInfo dst_info =
+ SkImageInfo::Make(info.width(), info.height(), buffer_color_type,
+ info.alphaType(), info.profileType());
+ // TODO(kaanb): The GL pipeline assumes a 4-byte alignment for the
+ // bitmap data. There will be no need to call SkAlign4 once crbug.com/293728
+ // is fixed.
+ const size_t dst_row_bytes = SkAlign4(dst_info.minRowBytes());
+ DCHECK_EQ(0u, dst_row_bytes % 4);
+ bool success = canvas->readPixels(dst_info, memory, dst_row_bytes, 0, 0);
+ DCHECK_EQ(true, success);
+ }
}
} // namespace cc

Powered by Google App Engine
This is Rietveld 408576698