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

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

Issue 132083007: cc: don't add low-res tiling to GPU rasterized layers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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/layers/picture_layer_impl.h ('k') | cc/layers/picture_layer_impl_unittest.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 #include <limits> 8 #include <limits>
9 9
10 #include "base/time/time.h" 10 #include "base/time/time.h"
(...skipping 927 matching lines...) Expand 10 before | Expand all | Expand 10 after
938 if (!high_res) { 938 if (!high_res) {
939 high_res = AddTiling(raster_contents_scale_); 939 high_res = AddTiling(raster_contents_scale_);
940 if (raster_contents_scale_ == low_res_raster_contents_scale_) 940 if (raster_contents_scale_ == low_res_raster_contents_scale_)
941 low_res = high_res; 941 low_res = high_res;
942 } 942 }
943 943
944 // Only create new low res tilings when the transform is static. This 944 // Only create new low res tilings when the transform is static. This
945 // prevents wastefully creating a paired low res tiling for every new high res 945 // prevents wastefully creating a paired low res tiling for every new high res
946 // tiling during a pinch or a CSS animation. 946 // tiling during a pinch or a CSS animation.
947 bool is_pinching = layer_tree_impl()->PinchGestureActive(); 947 bool is_pinching = layer_tree_impl()->PinchGestureActive();
948 if (!is_pinching && !animating_transform_to_screen && !low_res && 948 if (ShouldHaveLowResTiling() && !is_pinching &&
vmpstr 2014/01/10 00:52:02 We could technically have a case where after a sup
enne (OOO) 2014/01/10 01:42:34 I don't think so. I think you'd maybe need to add
949 low_res != high_res) 949 !animating_transform_to_screen &&
950 !low_res && low_res != high_res)
950 low_res = AddTiling(low_res_raster_contents_scale_); 951 low_res = AddTiling(low_res_raster_contents_scale_);
951 952
952 // Set low-res if we have one. 953 // Set low-res if we have one.
953 if (!low_res) 954 if (!low_res)
954 low_res = previous_low_res; 955 low_res = previous_low_res;
955 if (low_res && low_res != high_res) 956 if (low_res && low_res != high_res)
956 low_res->set_resolution(LOW_RESOLUTION); 957 low_res->set_resolution(LOW_RESOLUTION);
957 958
958 // Make sure we always have one high-res (even if high == low). 959 // Make sure we always have one high-res (even if high == low).
959 high_res->set_resolution(HIGH_RESOLUTION); 960 high_res->set_resolution(HIGH_RESOLUTION);
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
1230 size_t PictureLayerImpl::GPUMemoryUsageInBytes() const { 1231 size_t PictureLayerImpl::GPUMemoryUsageInBytes() const {
1231 const_cast<PictureLayerImpl*>(this)->DoPostCommitInitializationIfNeeded(); 1232 const_cast<PictureLayerImpl*>(this)->DoPostCommitInitializationIfNeeded();
1232 return tilings_->GPUMemoryUsageInBytes(); 1233 return tilings_->GPUMemoryUsageInBytes();
1233 } 1234 }
1234 1235
1235 void PictureLayerImpl::RunMicroBenchmark(MicroBenchmarkImpl* benchmark) { 1236 void PictureLayerImpl::RunMicroBenchmark(MicroBenchmarkImpl* benchmark) {
1236 benchmark->RunOnLayer(this); 1237 benchmark->RunOnLayer(this);
1237 } 1238 }
1238 1239
1239 } // namespace cc 1240 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/picture_layer_impl.h ('k') | cc/layers/picture_layer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698