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

Unified Diff: cc/layers/picture_layer_impl.cc

Issue 384643002: cc: Avoid redundant SQS setting and locals. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: avoid extra local rect. Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/picture_layer_impl.cc
diff --git a/cc/layers/picture_layer_impl.cc b/cc/layers/picture_layer_impl.cc
index 481536b1a04d15bc471dc96c85d63818edd8ce53..5bab778d4e3acc00b5543c8d80ad8e0865916654 100644
--- a/cc/layers/picture_layer_impl.cc
+++ b/cc/layers/picture_layer_impl.cc
@@ -154,7 +154,6 @@ void PictureLayerImpl::AppendQuads(
SharedQuadState* shared_quad_state =
render_pass->CreateAndAppendSharedQuadState();
- PopulateSharedQuadState(shared_quad_state);
shared_quad_state->SetAll(scaled_draw_transform,
scaled_content_bounds,
scaled_visible_content_rect,
@@ -164,8 +163,6 @@ void PictureLayerImpl::AppendQuads(
blend_mode(),
sorting_context_id_);
- gfx::Rect rect = scaled_visible_content_rect;
-
if (current_draw_mode_ == DRAW_MODE_RESOURCELESS_SOFTWARE) {
AppendDebugBorderQuad(
render_pass,
@@ -175,16 +172,16 @@ void PictureLayerImpl::AppendQuads(
DebugColors::DirectPictureBorderColor(),
DebugColors::DirectPictureBorderWidth(layer_tree_impl()));
- gfx::Rect geometry_rect = rect;
+ gfx::Rect geometry_rect = scaled_visible_content_rect;
gfx::Rect opaque_rect = contents_opaque() ? geometry_rect : gfx::Rect();
gfx::Rect visible_geometry_rect = occlusion_tracker.UnoccludedContentRect(
geometry_rect, scaled_draw_transform);
if (visible_geometry_rect.IsEmpty())
return;
- gfx::Size texture_size = rect.size();
+ gfx::Size texture_size = scaled_visible_content_rect.size();
gfx::RectF texture_rect = gfx::RectF(texture_size);
- gfx::Rect quad_content_rect = rect;
+ gfx::Rect quad_content_rect = scaled_visible_content_rect;
PictureDrawQuad* quad =
render_pass->CreateAndAppendDrawQuad<PictureDrawQuad>();
@@ -207,7 +204,10 @@ void PictureLayerImpl::AppendQuads(
if (ShowDebugBorders()) {
for (PictureLayerTilingSet::CoverageIterator iter(
- tilings_.get(), max_contents_scale, rect, ideal_contents_scale_);
+ tilings_.get(),
+ max_contents_scale,
+ scaled_visible_content_rect,
+ ideal_contents_scale_);
iter;
++iter) {
SkColor color;
@@ -257,8 +257,10 @@ void PictureLayerImpl::AppendQuads(
size_t missing_tile_count = 0u;
size_t on_demand_missing_tile_count = 0u;
- for (PictureLayerTilingSet::CoverageIterator iter(
- tilings_.get(), max_contents_scale, rect, ideal_contents_scale_);
+ for (PictureLayerTilingSet::CoverageIterator iter(tilings_.get(),
+ max_contents_scale,
+ scaled_visible_content_rect,
+ ideal_contents_scale_);
iter;
++iter) {
gfx::Rect geometry_rect = iter.geometry_rect();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698