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

Unified Diff: cc/output/gl_renderer.cc

Issue 21159007: cc: Adding support for RGBA_4444 tile textures (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix raster-on-demand codepath Created 7 years, 3 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/output/gl_renderer.cc
diff --git a/cc/output/gl_renderer.cc b/cc/output/gl_renderer.cc
index a80feac4ecc9f97f3fd5e731d99a43cc7ea98a99..7c8e1c7c88476d73d69eec94dce0c5aa2e6816a6 100644
--- a/cc/output/gl_renderer.cc
+++ b/cc/output/gl_renderer.cc
@@ -162,7 +162,8 @@ GLRenderer::GLRenderer(RendererClient* client,
highp_threshold_min_(highp_threshold_min),
highp_threshold_cache_(0),
offscreen_context_labelled_(false),
- on_demand_tile_raster_resource_id_(0) {
+ on_demand_tile_raster_resource_id_(0),
+ use_16_bit_resources_(resource_provider->use_16bit_textures()) {
DCHECK(context_);
}
@@ -1704,9 +1705,20 @@ void GLRenderer::DrawPictureQuad(const DrawingFrame* frame,
quad->picture_pile->RasterToBitmap(&canvas, quad->content_rect,
quad->contents_scale, NULL);
+ uint8_t* bitmap_pixels = NULL;
Sami 2013/09/05 14:13:26 Nit: const uint8_t*
kaanb 2013/09/06 02:05:54 Done.
+ if (use_16_bit_resources_) {
+ SkBitmap bitmap_16;
enne (OOO) 2013/09/05 02:01:19 This should probably be a member along with on_dem
Sami 2013/09/05 14:13:26 Furthermore, since bitmap_16 is on the stack, bitm
kaanb 2013/09/06 02:05:54 Done.
kaanb 2013/09/06 02:05:54 Great point. The overscroll glow is fixed now.
+ on_demand_tile_raster_bitmap_.copyTo(
+ &bitmap_16, SkBitmap::kARGB_4444_Config);
+ bitmap_pixels = reinterpret_cast<uint8_t*>(bitmap_16.getPixels());
+ } else {
+ bitmap_pixels = reinterpret_cast<uint8_t*>(
+ on_demand_tile_raster_bitmap_.getPixels());
+ }
+
resource_provider_->SetPixels(
on_demand_tile_raster_resource_id_,
- reinterpret_cast<uint8_t*>(on_demand_tile_raster_bitmap_.getPixels()),
+ bitmap_pixels,
gfx::Rect(quad->texture_size),
gfx::Rect(quad->texture_size),
gfx::Vector2d());

Powered by Google App Engine
This is Rietveld 408576698