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

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

Issue 21839004: cc: Push valid property values when CalcDrawProps skips layer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: pushpaintprops: Call SavePaintProps when needed in tests Created 7 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | cc/layers/layer.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/contents_scaling_layer.h" 5 #include "cc/layers/contents_scaling_layer.h"
6 #include "ui/gfx/size_conversions.h" 6 #include "ui/gfx/size_conversions.h"
7 7
8 namespace cc { 8 namespace cc {
9 9
10 gfx::Size ContentsScalingLayer::ComputeContentBoundsForScale( 10 gfx::Size ContentsScalingLayer::ComputeContentBoundsForScale(
(...skipping 20 matching lines...) Expand all
31 *contents_scale_x = ideal_contents_scale; 31 *contents_scale_x = ideal_contents_scale;
32 *contents_scale_y = ideal_contents_scale; 32 *contents_scale_y = ideal_contents_scale;
33 *content_bounds = ComputeContentBoundsForScale( 33 *content_bounds = ComputeContentBoundsForScale(
34 ideal_contents_scale, 34 ideal_contents_scale,
35 ideal_contents_scale); 35 ideal_contents_scale);
36 } 36 }
37 37
38 bool ContentsScalingLayer::Update( 38 bool ContentsScalingLayer::Update(
39 ResourceUpdateQueue* queue, 39 ResourceUpdateQueue* queue,
40 const OcclusionTracker* occlusion) { 40 const OcclusionTracker* occlusion) {
41 bool updated = Layer::Update(queue, occlusion);
42
41 if (draw_properties().contents_scale_x == last_update_contents_scale_x_ && 43 if (draw_properties().contents_scale_x == last_update_contents_scale_x_ &&
42 draw_properties().contents_scale_y == last_update_contents_scale_y_) 44 draw_properties().contents_scale_y == last_update_contents_scale_y_)
43 return false; 45 return updated;
44 46
45 last_update_contents_scale_x_ = draw_properties().contents_scale_x; 47 last_update_contents_scale_x_ = draw_properties().contents_scale_x;
46 last_update_contents_scale_y_ = draw_properties().contents_scale_y; 48 last_update_contents_scale_y_ = draw_properties().contents_scale_y;
47 // Invalidate the whole layer if scale changed. 49 // Invalidate the whole layer if scale changed.
48 SetNeedsDisplayRect(gfx::Rect(paint_properties().bounds)); 50 SetNeedsDisplayRect(gfx::Rect(paint_properties().bounds));
49 return false; 51 return updated;
50 } 52 }
51 53
52 } // namespace cc 54 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/layers/layer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698