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

Side by Side Diff: cc/layers/picture_layer_impl.cc

Issue 1380653003: Mac Overlays: Allow SolidColor and Tile quads to be candidates for overlays. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@AllOrNothing2
Patch Set: Plumb allow_overlay Created 5 years, 2 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/output/overlay_candidate.h » ('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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/layers/picture_layer_impl.h" 5 #include "cc/layers/picture_layer_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <limits> 9 #include <limits>
10 #include <set> 10 #include <set>
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 // the best the layer can promise in the future, consider those as 296 // the best the layer can promise in the future, consider those as
297 // complete. But if a tile is ideal scale, we don't want to consider 297 // complete. But if a tile is ideal scale, we don't want to consider
298 // it incomplete and trying to replace it with a tile at a worse 298 // it incomplete and trying to replace it with a tile at a worse
299 // scale. 299 // scale.
300 if (iter->contents_scale() != raster_contents_scale_ && 300 if (iter->contents_scale() != raster_contents_scale_ &&
301 iter->contents_scale() != ideal_contents_scale_ && 301 iter->contents_scale() != ideal_contents_scale_ &&
302 geometry_rect.Intersects(scaled_viewport_for_tile_priority)) { 302 geometry_rect.Intersects(scaled_viewport_for_tile_priority)) {
303 append_quads_data->num_incomplete_tiles++; 303 append_quads_data->num_incomplete_tiles++;
304 } 304 }
305 305
306 ResourceProvider::ScopedReadLockGpuMemoryBuffer lock(
307 layer_tree_impl()->resource_provider(), draw_info.resource_id());
Andre 2015/10/02 18:10:15 Here we want allow_overlay to be set if the resour
308
306 TileDrawQuad* quad = 309 TileDrawQuad* quad =
307 render_pass->CreateAndAppendDrawQuad<TileDrawQuad>(); 310 render_pass->CreateAndAppendDrawQuad<TileDrawQuad>();
308 quad->SetNew(shared_quad_state, geometry_rect, opaque_rect, 311 quad->SetNew(shared_quad_state, geometry_rect, opaque_rect,
309 visible_geometry_rect, draw_info.resource_id(), 312 visible_geometry_rect, draw_info.resource_id(),
310 texture_rect, draw_info.resource_size(), 313 texture_rect, draw_info.resource_size(),
311 draw_info.contents_swizzled(), nearest_neighbor_); 314 draw_info.contents_swizzled(), nearest_neighbor_,
315 lock.image_id() != 0);
312 ValidateQuadResources(quad); 316 ValidateQuadResources(quad);
313 iter->draw_info().set_was_ever_used_to_draw(); 317 iter->draw_info().set_was_ever_used_to_draw();
314 has_draw_quad = true; 318 has_draw_quad = true;
315 break; 319 break;
316 } 320 }
317 case TileDrawInfo::SOLID_COLOR_MODE: { 321 case TileDrawInfo::SOLID_COLOR_MODE: {
318 SolidColorDrawQuad* quad = 322 SolidColorDrawQuad* quad =
319 render_pass->CreateAndAppendDrawQuad<SolidColorDrawQuad>(); 323 render_pass->CreateAndAppendDrawQuad<SolidColorDrawQuad>();
320 quad->SetNew(shared_quad_state, geometry_rect, visible_geometry_rect, 324 quad->SetNew(shared_quad_state, geometry_rect, visible_geometry_rect,
321 draw_info.solid_color(), false); 325 draw_info.solid_color(), false);
(...skipping 924 matching lines...) Expand 10 before | Expand all | Expand 10 after
1246 1250
1247 bool PictureLayerImpl::IsOnActiveOrPendingTree() const { 1251 bool PictureLayerImpl::IsOnActiveOrPendingTree() const {
1248 return !layer_tree_impl()->IsRecycleTree(); 1252 return !layer_tree_impl()->IsRecycleTree();
1249 } 1253 }
1250 1254
1251 bool PictureLayerImpl::HasValidTilePriorities() const { 1255 bool PictureLayerImpl::HasValidTilePriorities() const {
1252 return IsOnActiveOrPendingTree() && IsDrawnRenderSurfaceLayerListMember(); 1256 return IsOnActiveOrPendingTree() && IsDrawnRenderSurfaceLayerListMember();
1253 } 1257 }
1254 1258
1255 } // namespace cc 1259 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/output/overlay_candidate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698