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/layers/picture_layer_impl.h" | 5 #include "cc/layers/picture_layer_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/time.h" | 9 #include "base/time.h" |
10 #include "cc/base/math_util.h" | 10 #include "cc/base/math_util.h" |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 | 352 |
353 scoped_refptr<Tile> PictureLayerImpl::CreateTile(PictureLayerTiling* tiling, | 353 scoped_refptr<Tile> PictureLayerImpl::CreateTile(PictureLayerTiling* tiling, |
354 gfx::Rect content_rect) { | 354 gfx::Rect content_rect) { |
355 if (!pile_->CanRaster(tiling->contents_scale(), content_rect)) | 355 if (!pile_->CanRaster(tiling->contents_scale(), content_rect)) |
356 return scoped_refptr<Tile>(); | 356 return scoped_refptr<Tile>(); |
357 | 357 |
358 return make_scoped_refptr(new Tile( | 358 return make_scoped_refptr(new Tile( |
359 layer_tree_impl()->tile_manager(), | 359 layer_tree_impl()->tile_manager(), |
360 pile_.get(), | 360 pile_.get(), |
361 content_rect.size(), | 361 content_rect.size(), |
362 GL_RGBA, | |
363 content_rect, | 362 content_rect, |
364 contents_opaque() ? content_rect : gfx::Rect(), | 363 contents_opaque() ? content_rect : gfx::Rect(), |
365 tiling->contents_scale(), | 364 tiling->contents_scale(), |
366 id())); | 365 id())); |
367 } | 366 } |
368 | 367 |
369 void PictureLayerImpl::UpdatePile(Tile* tile) { | 368 void PictureLayerImpl::UpdatePile(Tile* tile) { |
370 tile->set_picture_pile(pile_); | 369 tile->set_picture_pile(pile_); |
371 } | 370 } |
372 | 371 |
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
877 scoped_ptr<base::Value> PictureLayerImpl::AsValue() const { | 876 scoped_ptr<base::Value> PictureLayerImpl::AsValue() const { |
878 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); | 877 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); |
879 LayerImpl::AsValueInto(state.get()); | 878 LayerImpl::AsValueInto(state.get()); |
880 | 879 |
881 state->SetDouble("ideal_contents_scale", ideal_contents_scale_); | 880 state->SetDouble("ideal_contents_scale", ideal_contents_scale_); |
882 state->Set("tilings", tilings_->AsValue().release()); | 881 state->Set("tilings", tilings_->AsValue().release()); |
883 return state.PassAs<base::Value>(); | 882 return state.PassAs<base::Value>(); |
884 } | 883 } |
885 | 884 |
886 } // namespace cc | 885 } // namespace cc |
OLD | NEW |