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

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

Issue 334133002: cc: Support on demand raster with ganesh (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tests Created 6 years, 6 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 unified diff | Download patch | Annotate | Revision Log
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 1894 matching lines...) Expand 10 before | Expand all | Expand 10 after
1905 1905
1906 on_demand_tile_raster_resource_id_ = 1906 on_demand_tile_raster_resource_id_ =
1907 resource_provider_->CreateGLTexture(quad->texture_size, 1907 resource_provider_->CreateGLTexture(quad->texture_size,
1908 GL_TEXTURE_2D, 1908 GL_TEXTURE_2D,
1909 GL_TEXTURE_POOL_UNMANAGED_CHROMIUM, 1909 GL_TEXTURE_POOL_UNMANAGED_CHROMIUM,
1910 GL_CLAMP_TO_EDGE, 1910 GL_CLAMP_TO_EDGE,
1911 ResourceProvider::TextureUsageAny, 1911 ResourceProvider::TextureUsageAny,
1912 quad->texture_format); 1912 quad->texture_format);
1913 } 1913 }
1914 1914
1915 // Create and run on-demand raster task for tile. 1915 if (client_->UseTaskGraphRunnerForOnDemandRaster()) {
1916 scoped_refptr<Task> on_demand_raster_task( 1916 // Create and run on-demand raster task for tile.
1917 new OnDemandRasterTaskImpl(quad->picture_pile, 1917 scoped_refptr<Task> on_demand_raster_task(
1918 &on_demand_tile_raster_bitmap_, 1918 new OnDemandRasterTaskImpl(quad->picture_pile,
1919 quad->content_rect, 1919 &on_demand_tile_raster_bitmap_,
1920 quad->contents_scale)); 1920 quad->content_rect,
1921 RunOnDemandRasterTask(on_demand_raster_task.get()); 1921 quad->contents_scale));
1922 RunOnDemandRasterTask(on_demand_raster_task.get());
1923 } else {
1924 SkBitmapDevice device(on_demand_tile_raster_bitmap_);
1925 SkCanvas canvas(&device);
1926 quad->picture_pile->RasterToBitmap(
1927 &canvas, quad->content_rect, quad->contents_scale, NULL);
1928 }
1922 1929
1923 uint8_t* bitmap_pixels = NULL; 1930 uint8_t* bitmap_pixels = NULL;
1924 SkBitmap on_demand_tile_raster_bitmap_dest; 1931 SkBitmap on_demand_tile_raster_bitmap_dest;
1925 SkColorType colorType = ResourceFormatToSkColorType(quad->texture_format); 1932 SkColorType colorType = ResourceFormatToSkColorType(quad->texture_format);
1926 if (on_demand_tile_raster_bitmap_.colorType() != colorType) { 1933 if (on_demand_tile_raster_bitmap_.colorType() != colorType) {
1927 on_demand_tile_raster_bitmap_.copyTo(&on_demand_tile_raster_bitmap_dest, 1934 on_demand_tile_raster_bitmap_.copyTo(&on_demand_tile_raster_bitmap_dest,
1928 colorType); 1935 colorType);
1929 // TODO(kaanb): The GL pipeline assumes a 4-byte alignment for the 1936 // TODO(kaanb): The GL pipeline assumes a 4-byte alignment for the
1930 // bitmap data. This check will be removed once crbug.com/293728 is fixed. 1937 // bitmap data. This check will be removed once crbug.com/293728 is fixed.
1931 CHECK_EQ(0u, on_demand_tile_raster_bitmap_dest.rowBytes() % 4); 1938 CHECK_EQ(0u, on_demand_tile_raster_bitmap_dest.rowBytes() % 4);
(...skipping 1259 matching lines...) Expand 10 before | Expand all | Expand 10 after
3191 context_support_->ScheduleOverlayPlane( 3198 context_support_->ScheduleOverlayPlane(
3192 overlay.plane_z_order, 3199 overlay.plane_z_order,
3193 overlay.transform, 3200 overlay.transform,
3194 pending_overlay_resources_.back()->texture_id(), 3201 pending_overlay_resources_.back()->texture_id(),
3195 overlay.display_rect, 3202 overlay.display_rect,
3196 overlay.uv_rect); 3203 overlay.uv_rect);
3197 } 3204 }
3198 } 3205 }
3199 3206
3200 } // namespace cc 3207 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698