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

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

Issue 1139673008: cc: Make IsReadyToDraw/NeedsRaster usage consistent. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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/layers/picture_layer_impl_unittest.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 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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 AppendDebugBorderQuad(render_pass, shared_quad_state->content_bounds, 204 AppendDebugBorderQuad(render_pass, shared_quad_state->content_bounds,
205 shared_quad_state, append_quads_data); 205 shared_quad_state, append_quads_data);
206 206
207 if (ShowDebugBorders()) { 207 if (ShowDebugBorders()) {
208 for (PictureLayerTilingSet::CoverageIterator iter( 208 for (PictureLayerTilingSet::CoverageIterator iter(
209 tilings_.get(), max_contents_scale, 209 tilings_.get(), max_contents_scale,
210 shared_quad_state->visible_content_rect, ideal_contents_scale_); 210 shared_quad_state->visible_content_rect, ideal_contents_scale_);
211 iter; ++iter) { 211 iter; ++iter) {
212 SkColor color; 212 SkColor color;
213 float width; 213 float width;
214 if (*iter && iter->IsReadyToDraw()) { 214 if (*iter && iter->draw_info().IsReadyToDraw()) {
215 TileDrawInfo::Mode mode = iter->draw_info().mode(); 215 TileDrawInfo::Mode mode = iter->draw_info().mode();
216 if (mode == TileDrawInfo::SOLID_COLOR_MODE) { 216 if (mode == TileDrawInfo::SOLID_COLOR_MODE) {
217 color = DebugColors::SolidColorTileBorderColor(); 217 color = DebugColors::SolidColorTileBorderColor();
218 width = DebugColors::SolidColorTileBorderWidth(layer_tree_impl()); 218 width = DebugColors::SolidColorTileBorderWidth(layer_tree_impl());
219 } else if (mode == TileDrawInfo::OOM_MODE) { 219 } else if (mode == TileDrawInfo::OOM_MODE) {
220 color = DebugColors::OOMTileBorderColor(); 220 color = DebugColors::OOMTileBorderColor();
221 width = DebugColors::OOMTileBorderWidth(layer_tree_impl()); 221 width = DebugColors::OOMTileBorderWidth(layer_tree_impl());
222 } else if (iter.resolution() == HIGH_RESOLUTION) { 222 } else if (iter.resolution() == HIGH_RESOLUTION) {
223 color = DebugColors::HighResTileBorderColor(); 223 color = DebugColors::HighResTileBorderColor();
224 width = DebugColors::HighResTileBorderWidth(layer_tree_impl()); 224 width = DebugColors::HighResTileBorderWidth(layer_tree_impl());
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 gfx::Rect opaque_rect = contents_opaque() ? geometry_rect : gfx::Rect(); 270 gfx::Rect opaque_rect = contents_opaque() ? geometry_rect : gfx::Rect();
271 gfx::Rect visible_geometry_rect = 271 gfx::Rect visible_geometry_rect =
272 scaled_occlusion.GetUnoccludedContentRect(geometry_rect); 272 scaled_occlusion.GetUnoccludedContentRect(geometry_rect);
273 if (visible_geometry_rect.IsEmpty()) 273 if (visible_geometry_rect.IsEmpty())
274 continue; 274 continue;
275 275
276 append_quads_data->visible_content_area += 276 append_quads_data->visible_content_area +=
277 visible_geometry_rect.width() * visible_geometry_rect.height(); 277 visible_geometry_rect.width() * visible_geometry_rect.height();
278 278
279 bool has_draw_quad = false; 279 bool has_draw_quad = false;
280 if (*iter && iter->IsReadyToDraw()) { 280 if (*iter && iter->draw_info().IsReadyToDraw()) {
281 const TileDrawInfo& draw_info = iter->draw_info(); 281 const TileDrawInfo& draw_info = iter->draw_info();
282 switch (draw_info.mode()) { 282 switch (draw_info.mode()) {
283 case TileDrawInfo::RESOURCE_MODE: { 283 case TileDrawInfo::RESOURCE_MODE: {
284 gfx::RectF texture_rect = iter.texture_rect(); 284 gfx::RectF texture_rect = iter.texture_rect();
285 285
286 // The raster_contents_scale_ is the best scale that the layer is 286 // The raster_contents_scale_ is the best scale that the layer is
287 // trying to produce, even though it may not be ideal. Since that's 287 // trying to produce, even though it may not be ideal. Since that's
288 // the best the layer can promise in the future, consider those as 288 // the best the layer can promise in the future, consider those as
289 // complete. But if a tile is ideal scale, we don't want to consider 289 // complete. But if a tile is ideal scale, we don't want to consider
290 // it incomplete and trying to replace it with a tile at a worse 290 // it incomplete and trying to replace it with a tile at a worse
(...skipping 952 matching lines...) Expand 10 before | Expand all | Expand 10 after
1243 1243
1244 bool PictureLayerImpl::IsOnActiveOrPendingTree() const { 1244 bool PictureLayerImpl::IsOnActiveOrPendingTree() const {
1245 return !layer_tree_impl()->IsRecycleTree(); 1245 return !layer_tree_impl()->IsRecycleTree();
1246 } 1246 }
1247 1247
1248 bool PictureLayerImpl::HasValidTilePriorities() const { 1248 bool PictureLayerImpl::HasValidTilePriorities() const {
1249 return IsOnActiveOrPendingTree() && IsDrawnRenderSurfaceLayerListMember(); 1249 return IsOnActiveOrPendingTree() && IsDrawnRenderSurfaceLayerListMember();
1250 } 1250 }
1251 1251
1252 } // namespace cc 1252 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/layers/picture_layer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698