OLD | NEW |
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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 if (drawsContent()) { | 131 if (drawsContent()) { |
132 tilings_.SetLayerBounds(bounds()); | |
133 // TODO(enne): Add more tilings during pinch zoom. | 132 // TODO(enne): Add more tilings during pinch zoom. |
134 if (!tilings_.num_tilings()) { | 133 if (!tilings_.num_tilings()) { |
135 gfx::Size tile_size = layerTreeHostImpl()->settings().defaultTileSize; | 134 gfx::Size tile_size = layerTreeHostImpl()->settings().defaultTileSize; |
136 tilings_.AddTiling(contentsScaleX(), tile_size); | 135 tilings_.AddTiling(contentsScaleX(), tile_size); |
137 // TODO(enne): handle invalidations, create new tiles | 136 // TODO(enne): handle invalidations, create new tiles |
138 } | 137 } |
139 } else { | 138 } else { |
140 tilings_.Reset(); | 139 tilings_.Reset(); |
141 } | 140 } |
142 | 141 |
(...skipping 15 matching lines...) Expand all Loading... |
158 time_delta); | 157 time_delta); |
159 | 158 |
160 last_screen_space_transform_ = current_screen_space_transform; | 159 last_screen_space_transform_ = current_screen_space_transform; |
161 last_update_time_ = current_time; | 160 last_update_time_ = current_time; |
162 last_bounds_ = bounds(); | 161 last_bounds_ = bounds(); |
163 last_content_bounds_ = contentBounds(); | 162 last_content_bounds_ = contentBounds(); |
164 last_content_scale_x_ = contentsScaleX(); | 163 last_content_scale_x_ = contentsScaleX(); |
165 last_content_scale_y_ = contentsScaleY(); | 164 last_content_scale_y_ = contentsScaleY(); |
166 } | 165 } |
167 | 166 |
| 167 void PictureLayerImpl::didUpdateBounds() { |
| 168 tilings_.SetLayerBounds(bounds()); |
| 169 } |
| 170 |
168 scoped_refptr<Tile> PictureLayerImpl::CreateTile(PictureLayerTiling* tiling, | 171 scoped_refptr<Tile> PictureLayerImpl::CreateTile(PictureLayerTiling* tiling, |
169 gfx::Rect rect) { | 172 gfx::Rect rect) { |
170 TileManager* tile_manager = layerTreeHostImpl()->tileManager(); | 173 TileManager* tile_manager = layerTreeHostImpl()->tileManager(); |
171 | 174 |
172 return make_scoped_refptr(new Tile( | 175 return make_scoped_refptr(new Tile( |
173 tile_manager, | 176 tile_manager, |
174 pile_.get(), | 177 pile_.get(), |
175 rect.size(), | 178 rect.size(), |
176 GL_RGBA, | 179 GL_RGBA, |
177 rect, | 180 rect, |
178 tiling->contents_scale())); | 181 tiling->contents_scale())); |
179 } | 182 } |
180 | 183 |
181 void PictureLayerImpl::SyncFromActiveLayer(const PictureLayerImpl* other) { | 184 void PictureLayerImpl::SyncFromActiveLayer(const PictureLayerImpl* other) { |
182 tilings_.CloneFrom(other->tilings_); | 185 tilings_.CloneFrom(other->tilings_); |
183 } | 186 } |
184 | 187 |
185 } // namespace cc | 188 } // namespace cc |
OLD | NEW |