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

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

Issue 250803013: Don't clear render surfaces unnecessarily. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Make the bots happy. Created 6 years, 8 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
OLDNEW
1 // Copyright 2010 The Chromium Authors. All rights reserved. 1 // Copyright 2010 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/layer.h" 5 #include "cc/layers/layer.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 1042 matching lines...) Expand 10 before | Expand all | Expand 10 after
1053 void Layer::CreateRenderSurface() { 1053 void Layer::CreateRenderSurface() {
1054 DCHECK(!draw_properties_.render_surface); 1054 DCHECK(!draw_properties_.render_surface);
1055 draw_properties_.render_surface = make_scoped_ptr(new RenderSurface(this)); 1055 draw_properties_.render_surface = make_scoped_ptr(new RenderSurface(this));
1056 draw_properties_.render_target = this; 1056 draw_properties_.render_target = this;
1057 } 1057 }
1058 1058
1059 void Layer::ClearRenderSurface() { 1059 void Layer::ClearRenderSurface() {
1060 draw_properties_.render_surface.reset(); 1060 draw_properties_.render_surface.reset();
1061 } 1061 }
1062 1062
1063 void Layer::ClearRenderSurfaceLayerList() {
1064 if (draw_properties_.render_surface)
1065 draw_properties_.render_surface->layer_list().clear();
1066 }
1067
1063 gfx::Vector2dF Layer::ScrollOffsetForAnimation() const { 1068 gfx::Vector2dF Layer::ScrollOffsetForAnimation() const {
1064 return TotalScrollOffset(); 1069 return TotalScrollOffset();
1065 } 1070 }
1066 1071
1067 // On<Property>Animated is called due to an ongoing accelerated animation. 1072 // On<Property>Animated is called due to an ongoing accelerated animation.
1068 // Since this animation is also being run on the compositor thread, there 1073 // Since this animation is also being run on the compositor thread, there
1069 // is no need to request a commit to push this value over, so the value is 1074 // is no need to request a commit to push this value over, so the value is
1070 // set directly rather than by calling Set<Property>. 1075 // set directly rather than by calling Set<Property>.
1071 void Layer::OnFilterAnimated(const FilterOperations& filters) { 1076 void Layer::OnFilterAnimated(const FilterOperations& filters) {
1072 filters_ = filters; 1077 filters_ = filters;
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
1179 if (clip_parent_) 1184 if (clip_parent_)
1180 clip_parent_->RemoveClipChild(this); 1185 clip_parent_->RemoveClipChild(this);
1181 1186
1182 clip_parent_ = NULL; 1187 clip_parent_ = NULL;
1183 } 1188 }
1184 1189
1185 void Layer::RunMicroBenchmark(MicroBenchmark* benchmark) { 1190 void Layer::RunMicroBenchmark(MicroBenchmark* benchmark) {
1186 benchmark->RunOnLayer(this); 1191 benchmark->RunOnLayer(this);
1187 } 1192 }
1188 } // namespace cc 1193 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/layer.h ('k') | cc/layers/layer_impl.h » ('j') | cc/trees/layer_tree_host_common.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698