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

Side by Side Diff: cc/picture_layer_impl.cc

Issue 11467020: cc: Only create tilings for layers that draws content. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Don't create tilings unless drawsContent() is true Created 8 years 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/picture_layer_tiling_set.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/picture_layer_impl.h" 5 #include "cc/picture_layer_impl.h"
6 6
7 #include "base/time.h" 7 #include "base/time.h"
8 #include "cc/append_quads_data.h" 8 #include "cc/append_quads_data.h"
9 #include "cc/checkerboard_draw_quad.h" 9 #include "cc/checkerboard_draw_quad.h"
10 #include "cc/debug_border_draw_quad.h" 10 #include "cc/debug_border_draw_quad.h"
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 outside_bottom_edge && useAA); 121 outside_bottom_edge && useAA);
122 quadSink.append(quad.PassAs<DrawQuad>(), appendQuadsData); 122 quadSink.append(quad.PassAs<DrawQuad>(), appendQuadsData);
123 } 123 }
124 } 124 }
125 125
126 void PictureLayerImpl::dumpLayerProperties(std::string*, int indent) const { 126 void PictureLayerImpl::dumpLayerProperties(std::string*, int indent) const {
127 // TODO(enne): implement me 127 // TODO(enne): implement me
128 } 128 }
129 129
130 void PictureLayerImpl::didUpdateTransforms() { 130 void PictureLayerImpl::didUpdateTransforms() {
131 tilings_.SetLayerBounds(bounds()); 131 if (drawsContent()) {
132 // TODO(enne): Add more tilings during pinch zoom. 132 tilings_.SetLayerBounds(bounds());
133 if (!tilings_.num_tilings()) { 133 // TODO(enne): Add more tilings during pinch zoom.
134 gfx::Size tile_size = layerTreeHostImpl()->settings().defaultTileSize; 134 if (!tilings_.num_tilings()) {
135 tilings_.AddTiling(contentsScaleX(), tile_size); 135 gfx::Size tile_size = layerTreeHostImpl()->settings().defaultTileSize;
136 // TODO(enne): handle invalidations, create new tiles 136 tilings_.AddTiling(contentsScaleX(), tile_size);
137 // TODO(enne): handle invalidations, create new tiles
138 }
139 } else {
140 tilings_.Reset();
137 } 141 }
138 142
139 gfx::Transform current_screen_space_transform = screenSpaceTransform(); 143 gfx::Transform current_screen_space_transform = screenSpaceTransform();
140 double current_time = 144 double current_time =
141 (base::TimeTicks::Now() - base::TimeTicks()).InSecondsF(); 145 (base::TimeTicks::Now() - base::TimeTicks()).InSecondsF();
142 double time_delta = 0; 146 double time_delta = 0;
143 if (last_update_time_ != 0 && last_bounds_ == bounds() && 147 if (last_update_time_ != 0 && last_bounds_ == bounds() &&
144 last_content_bounds_ == contentBounds() && 148 last_content_bounds_ == contentBounds() &&
145 last_content_scale_x_ == contentsScaleX() && 149 last_content_scale_x_ == contentsScaleX() &&
146 last_content_scale_y_ == contentsScaleY()) { 150 last_content_scale_y_ == contentsScaleY()) {
(...skipping 25 matching lines...) Expand all
172 GL_RGBA, 176 GL_RGBA,
173 rect, 177 rect,
174 tiling->contents_scale())); 178 tiling->contents_scale()));
175 } 179 }
176 180
177 void PictureLayerImpl::SyncFromActiveLayer(const PictureLayerImpl* other) { 181 void PictureLayerImpl::SyncFromActiveLayer(const PictureLayerImpl* other) {
178 tilings_.CloneFrom(other->tilings_); 182 tilings_.CloneFrom(other->tilings_);
179 } 183 }
180 184
181 } // namespace cc 185 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/picture_layer_tiling_set.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698