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

Side by Side Diff: cc/output/gl_renderer.cc

Issue 666273002: cc: Added raster source. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « cc/layers/picture_layer_impl_unittest.cc ('k') | cc/resources/bitmap_raster_worker_pool.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2010 The Chromium Authors. All rights reserved. 1 // Copyright 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/output/gl_renderer.h" 5 #include "cc/output/gl_renderer.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 2013 matching lines...) Expand 10 before | Expand all | Expand 10 after
2024 on_demand_tile_raster_resource_id_ = resource_provider_->CreateGLTexture( 2024 on_demand_tile_raster_resource_id_ = resource_provider_->CreateGLTexture(
2025 quad->texture_size, 2025 quad->texture_size,
2026 GL_TEXTURE_2D, 2026 GL_TEXTURE_2D,
2027 GL_TEXTURE_POOL_UNMANAGED_CHROMIUM, 2027 GL_TEXTURE_POOL_UNMANAGED_CHROMIUM,
2028 GL_CLAMP_TO_EDGE, 2028 GL_CLAMP_TO_EDGE,
2029 ResourceProvider::TextureHintImmutable, 2029 ResourceProvider::TextureHintImmutable,
2030 quad->texture_format); 2030 quad->texture_format);
2031 } 2031 }
2032 2032
2033 SkCanvas canvas(on_demand_tile_raster_bitmap_); 2033 SkCanvas canvas(on_demand_tile_raster_bitmap_);
2034 quad->picture_pile->RasterToBitmap( 2034 quad->picture_pile->PlaybackToCanvas(
2035 &canvas, quad->content_rect, quad->contents_scale, NULL); 2035 &canvas, quad->content_rect, quad->contents_scale, NULL);
2036 2036
2037 uint8_t* bitmap_pixels = NULL; 2037 uint8_t* bitmap_pixels = NULL;
2038 SkBitmap on_demand_tile_raster_bitmap_dest; 2038 SkBitmap on_demand_tile_raster_bitmap_dest;
2039 SkColorType colorType = ResourceFormatToSkColorType(quad->texture_format); 2039 SkColorType colorType = ResourceFormatToSkColorType(quad->texture_format);
2040 if (on_demand_tile_raster_bitmap_.colorType() != colorType) { 2040 if (on_demand_tile_raster_bitmap_.colorType() != colorType) {
2041 on_demand_tile_raster_bitmap_.copyTo(&on_demand_tile_raster_bitmap_dest, 2041 on_demand_tile_raster_bitmap_.copyTo(&on_demand_tile_raster_bitmap_dest,
2042 colorType); 2042 colorType);
2043 // TODO(kaanb): The GL pipeline assumes a 4-byte alignment for the 2043 // TODO(kaanb): The GL pipeline assumes a 4-byte alignment for the
2044 // bitmap data. This check will be removed once crbug.com/293728 is fixed. 2044 // bitmap data. This check will be removed once crbug.com/293728 is fixed.
(...skipping 1305 matching lines...) Expand 10 before | Expand all | Expand 10 after
3350 context_support_->ScheduleOverlayPlane( 3350 context_support_->ScheduleOverlayPlane(
3351 overlay.plane_z_order, 3351 overlay.plane_z_order,
3352 overlay.transform, 3352 overlay.transform,
3353 pending_overlay_resources_.back()->texture_id(), 3353 pending_overlay_resources_.back()->texture_id(),
3354 overlay.display_rect, 3354 overlay.display_rect,
3355 overlay.uv_rect); 3355 overlay.uv_rect);
3356 } 3356 }
3357 } 3357 }
3358 3358
3359 } // namespace cc 3359 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/picture_layer_impl_unittest.cc ('k') | cc/resources/bitmap_raster_worker_pool.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698