| 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/layer_impl.h" | 5 #include "cc/layers/layer_impl.h" |
| 6 | 6 |
| 7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
| 8 #include "base/json/json_reader.h" | 8 #include "base/json/json_reader.h" |
| 9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 10 #include "cc/animation/animation_registrar.h" | 10 #include "cc/animation/animation_registrar.h" |
| (...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 472 // Intersect with content rect to avoid the extra pixel because for some | 472 // Intersect with content rect to avoid the extra pixel because for some |
| 473 // values x and y, ceil((x / y) * y) may be x + 1. | 473 // values x and y, ceil((x / y) * y) may be x + 1. |
| 474 content_rect.Intersect(gfx::Rect(content_bounds())); | 474 content_rect.Intersect(gfx::Rect(content_bounds())); |
| 475 return gfx::ToEnclosingRect(content_rect); | 475 return gfx::ToEnclosingRect(content_rect); |
| 476 } | 476 } |
| 477 | 477 |
| 478 skia::RefPtr<SkPicture> LayerImpl::GetPicture() { | 478 skia::RefPtr<SkPicture> LayerImpl::GetPicture() { |
| 479 return skia::RefPtr<SkPicture>(); | 479 return skia::RefPtr<SkPicture>(); |
| 480 } | 480 } |
| 481 | 481 |
| 482 bool LayerImpl::AreVisibleResourcesReady() const { | |
| 483 return true; | |
| 484 } | |
| 485 | |
| 486 scoped_ptr<LayerImpl> LayerImpl::CreateLayerImpl(LayerTreeImpl* tree_impl) { | 482 scoped_ptr<LayerImpl> LayerImpl::CreateLayerImpl(LayerTreeImpl* tree_impl) { |
| 487 return LayerImpl::Create(tree_impl, layer_id_); | 483 return LayerImpl::Create(tree_impl, layer_id_); |
| 488 } | 484 } |
| 489 | 485 |
| 490 void LayerImpl::PushPropertiesTo(LayerImpl* layer) { | 486 void LayerImpl::PushPropertiesTo(LayerImpl* layer) { |
| 491 layer->SetTransformOrigin(transform_origin_); | 487 layer->SetTransformOrigin(transform_origin_); |
| 492 layer->SetBackgroundColor(background_color_); | 488 layer->SetBackgroundColor(background_color_); |
| 493 layer->SetBounds(bounds_); | 489 layer->SetBounds(bounds_); |
| 494 layer->SetContentBounds(content_bounds()); | 490 layer->SetContentBounds(content_bounds()); |
| 495 layer->SetContentsScale(contents_scale_x(), contents_scale_y()); | 491 layer->SetContentsScale(contents_scale_x(), contents_scale_y()); |
| (...skipping 1005 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1501 scoped_ptr<base::Value> LayerImpl::AsValue() const { | 1497 scoped_ptr<base::Value> LayerImpl::AsValue() const { |
| 1502 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); | 1498 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); |
| 1503 AsValueInto(state.get()); | 1499 AsValueInto(state.get()); |
| 1504 return state.PassAs<base::Value>(); | 1500 return state.PassAs<base::Value>(); |
| 1505 } | 1501 } |
| 1506 | 1502 |
| 1507 void LayerImpl::RunMicroBenchmark(MicroBenchmarkImpl* benchmark) { | 1503 void LayerImpl::RunMicroBenchmark(MicroBenchmarkImpl* benchmark) { |
| 1508 benchmark->RunOnLayer(this); | 1504 benchmark->RunOnLayer(this); |
| 1509 } | 1505 } |
| 1510 } // namespace cc | 1506 } // namespace cc |
| OLD | NEW |