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

Side by Side Diff: cc/resources/gpu_rasterizer.cc

Issue 817133006: Support different formats in the same resource pool. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add a TODO about removing the default format. Created 5 years, 11 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
« no previous file with comments | « no previous file | cc/resources/one_copy_tile_task_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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/resources/gpu_rasterizer.h" 5 #include "cc/resources/gpu_rasterizer.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 ResourcePool* resource_pool, 61 ResourcePool* resource_pool,
62 const UpdateTileDrawInfoCallback& update_tile_draw_info) { 62 const UpdateTileDrawInfoCallback& update_tile_draw_info) {
63 ScopedGpuRaster gpu_raster(context_provider_); 63 ScopedGpuRaster gpu_raster(context_provider_);
64 64
65 ScopedResourceWriteLocks locks; 65 ScopedResourceWriteLocks locks;
66 66
67 for (Tile* tile : tiles) { 67 for (Tile* tile : tiles) {
68 // TODO(hendrikw): Don't create resources for solid color tiles. 68 // TODO(hendrikw): Don't create resources for solid color tiles.
69 // See crbug.com/445919 69 // See crbug.com/445919
70 scoped_ptr<ScopedResource> resource = 70 scoped_ptr<ScopedResource> resource =
71 resource_pool->AcquireResource(tile->desired_texture_size()); 71 resource_pool->AcquireResource(tile->desired_texture_size(),
72 resource_pool->default_format());
72 const ScopedResource* const_resource = resource.get(); 73 const ScopedResource* const_resource = resource.get();
73 74
74 RasterSource::SolidColorAnalysis analysis; 75 RasterSource::SolidColorAnalysis analysis;
75 76
76 if (tile->use_picture_analysis()) 77 if (tile->use_picture_analysis())
77 PerformSolidColorAnalysis(tile, &analysis); 78 PerformSolidColorAnalysis(tile, &analysis);
78 79
79 if (!analysis.is_solid_color) 80 if (!analysis.is_solid_color)
80 AddToMultiPictureDraw(tile, const_resource, &locks); 81 AddToMultiPictureDraw(tile, const_resource, &locks);
81 82
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 tile->raster_source()->PlaybackToCanvas(canvas.get(), tile->content_rect(), 140 tile->raster_source()->PlaybackToCanvas(canvas.get(), tile->content_rect(),
140 tile->contents_scale()); 141 tile->contents_scale());
141 canvas->restore(); 142 canvas->restore();
142 143
143 // Add the canvas and recorded picture to |multi_picture_draw_|. 144 // Add the canvas and recorded picture to |multi_picture_draw_|.
144 skia::RefPtr<SkPicture> picture = skia::AdoptRef(recorder.endRecording()); 145 skia::RefPtr<SkPicture> picture = skia::AdoptRef(recorder.endRecording());
145 multi_picture_draw_.add(sk_surface->getCanvas(), picture.get()); 146 multi_picture_draw_.add(sk_surface->getCanvas(), picture.get());
146 } 147 }
147 148
148 } // namespace cc 149 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/resources/one_copy_tile_task_worker_pool.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698