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

Side by Side Diff: cc/contents_scaling_layer.cc

Issue 12095053: cc: Avoid expensive RenderingStats collection. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nits Created 7 years, 10 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 | « cc/contents_scaling_layer.h ('k') | cc/heads_up_display_layer.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/contents_scaling_layer.h" 5 #include "cc/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(float scaleX, float scaleY) const { 10 gfx::Size ContentsScalingLayer::computeContentBoundsForScale(float scaleX, float scaleY) const {
(...skipping 23 matching lines...) Expand all
34 34
35 void ContentsScalingLayer::didUpdateBounds() { 35 void ContentsScalingLayer::didUpdateBounds() {
36 drawProperties().content_bounds = computeContentBoundsForScale( 36 drawProperties().content_bounds = computeContentBoundsForScale(
37 contentsScaleX(), 37 contentsScaleX(),
38 contentsScaleY()); 38 contentsScaleY());
39 } 39 }
40 40
41 void ContentsScalingLayer::update( 41 void ContentsScalingLayer::update(
42 ResourceUpdateQueue& queue, 42 ResourceUpdateQueue& queue,
43 const OcclusionTracker* occlusion, 43 const OcclusionTracker* occlusion,
44 RenderingStats& stats) { 44 RenderingStats* stats) {
45 if (drawProperties().contents_scale_x == last_update_contents_scale_x_ && 45 if (drawProperties().contents_scale_x == last_update_contents_scale_x_ &&
46 drawProperties().contents_scale_y == last_update_contents_scale_y_) 46 drawProperties().contents_scale_y == last_update_contents_scale_y_)
47 return; 47 return;
48 48
49 last_update_contents_scale_x_ = drawProperties().contents_scale_x; 49 last_update_contents_scale_x_ = drawProperties().contents_scale_x;
50 last_update_contents_scale_y_ = drawProperties().contents_scale_y; 50 last_update_contents_scale_y_ = drawProperties().contents_scale_y;
51 // Invalidate the whole layer if scale changed. 51 // Invalidate the whole layer if scale changed.
52 setNeedsDisplayRect(gfx::Rect(bounds())); 52 setNeedsDisplayRect(gfx::Rect(bounds()));
53 } 53 }
54 54
55 } // namespace cc 55 } // namespace cc
OLDNEW
« no previous file with comments | « cc/contents_scaling_layer.h ('k') | cc/heads_up_display_layer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698