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

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 and forward flags 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
« no previous file with comments | « cc/raster/one_copy_tile_task_worker_pool.cc ('k') | cc/raster/zero_copy_tile_task_worker_pool.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 8829e2c6881681bcfc8e029f344988ffcdac2a87..e980c8525de94255dfbb797c3c5b8e895169f64f 100644
--- a/cc/raster/tile_task_worker_pool.cc
+++ b/cc/raster/tile_task_worker_pool.cc
@@ -182,6 +182,8 @@ void TileTaskWorkerPool::PlaybackToMemory(void* memory,
const gfx::Rect& canvas_playback_rect,
float scale,
bool include_images) {
+ TRACE_EVENT0("cc", "TileTaskWorkerPool::PlaybackToMemory");
+
DCHECK(IsSupportedPlaybackToMemoryFormat(format)) << format;
// Uses kPremul_SkAlphaType since the result is not known to be opaque.
@@ -219,19 +221,25 @@ void TileTaskWorkerPool::PlaybackToMemory(void* memory,
skia::AdoptRef(SkSurface::NewRaster(info, &surface_props));
skia::RefPtr<SkCanvas> canvas = skia::SharePtr(surface->getCanvas());
canvas->setDrawFilter(image_filter.get());
+ // TODO(reveman): Improve partial raster support by reducing the size of
+ // playback rect passed to PlaybackToCanvas. crbug.com/519070
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);
+
+ {
+ 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
« no previous file with comments | « cc/raster/one_copy_tile_task_worker_pool.cc ('k') | cc/raster/zero_copy_tile_task_worker_pool.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698