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

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

Issue 63153003: mac: Prepare for -Wunused-functions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 1 month 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 | « base/time/time_posix.cc ('k') | cc/resources/tile_priority.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 8
9 #include "base/time/time.h" 9 #include "base/time/time.h"
10 #include "cc/base/math_util.h" 10 #include "cc/base/math_util.h"
(...skipping 770 matching lines...) Expand 10 before | Expand all | Expand 10 after
781 } 781 }
782 782
783 namespace { 783 namespace {
784 784
785 inline float PositiveRatio(float float1, float float2) { 785 inline float PositiveRatio(float float1, float float2) {
786 DCHECK_GT(float1, 0); 786 DCHECK_GT(float1, 0);
787 DCHECK_GT(float2, 0); 787 DCHECK_GT(float2, 0);
788 return float1 > float2 ? float1 / float2 : float2 / float1; 788 return float1 > float2 ? float1 / float2 : float2 / float1;
789 } 789 }
790 790
791 inline bool IsCloserToThan(
792 PictureLayerTiling* layer1,
793 PictureLayerTiling* layer2,
794 float contents_scale) {
795 // Absolute value for ratios.
796 float ratio1 = PositiveRatio(layer1->contents_scale(), contents_scale);
797 float ratio2 = PositiveRatio(layer2->contents_scale(), contents_scale);
798 return ratio1 < ratio2;
799 }
800
801 } // namespace 791 } // namespace
802 792
803 void PictureLayerImpl::ManageTilings(bool animating_transform_to_screen) { 793 void PictureLayerImpl::ManageTilings(bool animating_transform_to_screen) {
804 DCHECK(ideal_contents_scale_); 794 DCHECK(ideal_contents_scale_);
805 DCHECK(ideal_page_scale_); 795 DCHECK(ideal_page_scale_);
806 DCHECK(ideal_device_scale_); 796 DCHECK(ideal_device_scale_);
807 DCHECK(ideal_source_scale_); 797 DCHECK(ideal_source_scale_);
808 DCHECK(CanHaveTilings()); 798 DCHECK(CanHaveTilings());
809 DCHECK(!needs_post_commit_initialization_); 799 DCHECK(!needs_post_commit_initialization_);
810 800
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
1094 state->Set("coverage_tiles", coverage_tiles.release()); 1084 state->Set("coverage_tiles", coverage_tiles.release());
1095 state->SetBoolean("is_using_lcd_text", is_using_lcd_text_); 1085 state->SetBoolean("is_using_lcd_text", is_using_lcd_text_);
1096 } 1086 }
1097 1087
1098 size_t PictureLayerImpl::GPUMemoryUsageInBytes() const { 1088 size_t PictureLayerImpl::GPUMemoryUsageInBytes() const {
1099 const_cast<PictureLayerImpl*>(this)->DoPostCommitInitializationIfNeeded(); 1089 const_cast<PictureLayerImpl*>(this)->DoPostCommitInitializationIfNeeded();
1100 return tilings_->GPUMemoryUsageInBytes(); 1090 return tilings_->GPUMemoryUsageInBytes();
1101 } 1091 }
1102 1092
1103 } // namespace cc 1093 } // namespace cc
OLDNEW
« no previous file with comments | « base/time/time_posix.cc ('k') | cc/resources/tile_priority.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698