| 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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 const PictureLayerTiling* tiling = tilings_.tiling_at(i); | 185 const PictureLayerTiling* tiling = tilings_.tiling_at(i); |
| 186 max_contents_scale = std::max(max_contents_scale, tiling->contents_scale()); | 186 max_contents_scale = std::max(max_contents_scale, tiling->contents_scale()); |
| 187 } | 187 } |
| 188 | 188 |
| 189 *contents_scale_x = max_contents_scale; | 189 *contents_scale_x = max_contents_scale; |
| 190 *contents_scale_y = max_contents_scale; | 190 *contents_scale_y = max_contents_scale; |
| 191 *content_bounds = gfx::ToCeiledSize( | 191 *content_bounds = gfx::ToCeiledSize( |
| 192 gfx::ScaleSize(bounds(), max_contents_scale, max_contents_scale)); | 192 gfx::ScaleSize(bounds(), max_contents_scale, max_contents_scale)); |
| 193 } | 193 } |
| 194 | 194 |
| 195 skia::RefPtr<SkPicture> PictureLayerImpl::getPicture() { |
| 196 return pile_->GetFlattenedPicture(); |
| 197 } |
| 198 |
| 195 scoped_refptr<Tile> PictureLayerImpl::CreateTile(PictureLayerTiling* tiling, | 199 scoped_refptr<Tile> PictureLayerImpl::CreateTile(PictureLayerTiling* tiling, |
| 196 gfx::Rect rect) { | 200 gfx::Rect rect) { |
| 197 TileManager* tile_manager = layerTreeImpl()->tile_manager(); | 201 TileManager* tile_manager = layerTreeImpl()->tile_manager(); |
| 198 | 202 |
| 199 return make_scoped_refptr(new Tile( | 203 return make_scoped_refptr(new Tile( |
| 200 tile_manager, | 204 tile_manager, |
| 201 pile_.get(), | 205 pile_.get(), |
| 202 rect.size(), | 206 rect.size(), |
| 203 GL_RGBA, | 207 GL_RGBA, |
| 204 rect, | 208 rect, |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 AddTiling(ideal_contents_scale, TileSize()); | 297 AddTiling(ideal_contents_scale, TileSize()); |
| 294 // TODO(enne): Add a low-res tiling as well. | 298 // TODO(enne): Add a low-res tiling as well. |
| 295 } | 299 } |
| 296 } else { | 300 } else { |
| 297 // TODO(enne): This should be unnecessary once there are two trees. | 301 // TODO(enne): This should be unnecessary once there are two trees. |
| 298 tilings_.Reset(); | 302 tilings_.Reset(); |
| 299 } | 303 } |
| 300 } | 304 } |
| 301 | 305 |
| 302 } // namespace cc | 306 } // namespace cc |
| OLD | NEW |