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

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

Issue 350183005: cc: update scaled transform to occlusion tracker during append quad. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updated 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
« no previous file with comments | « no previous file | no next file » | 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 <limits> 8 #include <limits>
9 9
10 #include "base/time/time.h" 10 #include "base/time/time.h"
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 132
133 // We always need to push properties. 133 // We always need to push properties.
134 // See http://crbug.com/303943 134 // See http://crbug.com/303943
135 needs_push_properties_ = true; 135 needs_push_properties_ = true;
136 } 136 }
137 137
138 void PictureLayerImpl::AppendQuads(QuadSink* quad_sink, 138 void PictureLayerImpl::AppendQuads(QuadSink* quad_sink,
139 AppendQuadsData* append_quads_data) { 139 AppendQuadsData* append_quads_data) {
140 DCHECK(!needs_post_commit_initialization_); 140 DCHECK(!needs_post_commit_initialization_);
141 141
142 float max_contents_scale = MaximumTilingContentsScale(); 142 float max_contents_scale = MaximumTilingContentsScale();
sohanjg 2014/06/24 16:18:01 If we avoid scaling to max scale here, the black p
143 gfx::Transform scaled_draw_transform = draw_transform(); 143 gfx::Transform scaled_draw_transform = draw_transform();
144 scaled_draw_transform.Scale(SK_MScalar1 / max_contents_scale, 144 scaled_draw_transform.Scale(SK_MScalar1 / max_contents_scale,
145 SK_MScalar1 / max_contents_scale); 145 SK_MScalar1 / max_contents_scale);
146
146 gfx::Size scaled_content_bounds = 147 gfx::Size scaled_content_bounds =
147 gfx::ToCeiledSize(gfx::ScaleSize(content_bounds(), max_contents_scale)); 148 gfx::ToCeiledSize(gfx::ScaleSize(bounds(), max_contents_scale));
sohanjg 2014/06/24 16:18:01 this is keeping same behavior as old code, where w
enne (OOO) 2014/06/24 18:06:11 This does not seem right to me. This makes scaled
sohanjg 2014/06/25 13:26:52 Do you mean the scaled_content_bounds calculation
148 149
149 gfx::Rect scaled_visible_content_rect = 150 gfx::Rect scaled_visible_content_rect =
150 gfx::ScaleToEnclosingRect(visible_content_rect(), max_contents_scale); 151 gfx::ScaleToEnclosingRect(visible_content_rect(), max_contents_scale);
151 scaled_visible_content_rect.Intersect(gfx::Rect(scaled_content_bounds)); 152 scaled_visible_content_rect.Intersect(gfx::Rect(scaled_content_bounds));
152 153
153 SharedQuadState* shared_quad_state = quad_sink->CreateSharedQuadState(); 154 SharedQuadState* shared_quad_state = quad_sink->CreateSharedQuadState();
154 shared_quad_state->SetAll(scaled_draw_transform, 155 draw_properties().target_space_transform = scaled_draw_transform;
enne (OOO) 2014/06/24 18:06:11 Sorry, but no. Draw properties should only be set
sohanjg 2014/06/25 13:26:52 Yes, this was just to try and fix the black patch
155 scaled_content_bounds, 156 draw_properties().content_bounds = scaled_content_bounds;
156 scaled_visible_content_rect, 157 draw_properties().visible_content_rect = scaled_visible_content_rect;
157 draw_properties().clip_rect, 158 PopulateSharedQuadState(shared_quad_state);
158 draw_properties().is_clipped,
159 draw_properties().opacity,
160 blend_mode(),
161 sorting_context_id_);
162 159
163 gfx::Rect rect = scaled_visible_content_rect; 160 gfx::Rect rect = scaled_visible_content_rect;
164 161
165 if (current_draw_mode_ == DRAW_MODE_RESOURCELESS_SOFTWARE) { 162 if (current_draw_mode_ == DRAW_MODE_RESOURCELESS_SOFTWARE) {
166 AppendDebugBorderQuad( 163 AppendDebugBorderQuad(
167 quad_sink, 164 quad_sink,
168 shared_quad_state, 165 shared_quad_state,
169 append_quads_data, 166 append_quads_data,
170 DebugColors::DirectPictureBorderColor(), 167 DebugColors::DirectPictureBorderColor(),
171 DebugColors::DirectPictureBorderWidth(layer_tree_impl())); 168 DebugColors::DirectPictureBorderWidth(layer_tree_impl()));
(...skipping 1441 matching lines...) Expand 10 before | Expand all | Expand 10 after
1613 return iterator_index_ < iterators_.size(); 1610 return iterator_index_ < iterators_.size();
1614 } 1611 }
1615 1612
1616 bool PictureLayerImpl::LayerEvictionTileIterator::IsCorrectType( 1613 bool PictureLayerImpl::LayerEvictionTileIterator::IsCorrectType(
1617 PictureLayerTiling::TilingEvictionTileIterator* it) const { 1614 PictureLayerTiling::TilingEvictionTileIterator* it) const {
1618 return it->get_type() == iteration_stage_ && 1615 return it->get_type() == iteration_stage_ &&
1619 (**it)->required_for_activation() == required_for_activation_; 1616 (**it)->required_for_activation() == required_for_activation_;
1620 } 1617 }
1621 1618
1622 } // namespace cc 1619 } // namespace cc
OLDNEW
« 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