| 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/json/json_reader.h" | 7 #include "base/json/json_reader.h" |
| 8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
| 9 #include "base/trace_event/trace_event.h" | 9 #include "base/trace_event/trace_event.h" |
| 10 #include "base/trace_event/trace_event_argument.h" | 10 #include "base/trace_event/trace_event_argument.h" |
| (...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 } | 372 } |
| 373 | 373 |
| 374 RenderPassId LayerImpl::FirstContributingRenderPassId() const { | 374 RenderPassId LayerImpl::FirstContributingRenderPassId() const { |
| 375 return RenderPassId(0, 0); | 375 return RenderPassId(0, 0); |
| 376 } | 376 } |
| 377 | 377 |
| 378 RenderPassId LayerImpl::NextContributingRenderPassId(RenderPassId id) const { | 378 RenderPassId LayerImpl::NextContributingRenderPassId(RenderPassId id) const { |
| 379 return RenderPassId(0, 0); | 379 return RenderPassId(0, 0); |
| 380 } | 380 } |
| 381 | 381 |
| 382 void LayerImpl::GetContentsResourceId(ResourceProvider::ResourceId* resource_id, | 382 void LayerImpl::GetContentsResourceId(ResourceId* resource_id, |
| 383 gfx::Size* resource_size) const { | 383 gfx::Size* resource_size) const { |
| 384 NOTREACHED(); | 384 NOTREACHED(); |
| 385 *resource_id = 0; | 385 *resource_id = 0; |
| 386 } | 386 } |
| 387 | 387 |
| 388 gfx::Vector2dF LayerImpl::ScrollBy(const gfx::Vector2dF& scroll) { | 388 gfx::Vector2dF LayerImpl::ScrollBy(const gfx::Vector2dF& scroll) { |
| 389 gfx::ScrollOffset adjusted_scroll(scroll); | 389 gfx::ScrollOffset adjusted_scroll(scroll); |
| 390 if (layer_tree_impl()->settings().use_pinch_virtual_viewport) { | 390 if (layer_tree_impl()->settings().use_pinch_virtual_viewport) { |
| 391 if (!user_scrollable_horizontal_) | 391 if (!user_scrollable_horizontal_) |
| 392 adjusted_scroll.set_x(0); | 392 adjusted_scroll.set_x(0); |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 741 | 741 |
| 742 void LayerImpl::NoteLayerPropertyChangedForDescendants() { | 742 void LayerImpl::NoteLayerPropertyChangedForDescendants() { |
| 743 layer_tree_impl()->set_needs_update_draw_properties(); | 743 layer_tree_impl()->set_needs_update_draw_properties(); |
| 744 for (size_t i = 0; i < children_.size(); ++i) | 744 for (size_t i = 0; i < children_.size(); ++i) |
| 745 children_[i]->NoteLayerPropertyChangedForDescendantsInternal(); | 745 children_[i]->NoteLayerPropertyChangedForDescendantsInternal(); |
| 746 SetNeedsPushProperties(); | 746 SetNeedsPushProperties(); |
| 747 } | 747 } |
| 748 | 748 |
| 749 #if DCHECK_IS_ON() | 749 #if DCHECK_IS_ON() |
| 750 // Verify that the resource id is valid. | 750 // Verify that the resource id is valid. |
| 751 static ResourceProvider::ResourceId ValidateResource( | 751 static ResourceId ValidateResource(const ResourceProvider* provider, |
| 752 const ResourceProvider* provider, | 752 ResourceId id) { |
| 753 ResourceProvider::ResourceId id) { | |
| 754 provider->ValidateResource(id); | 753 provider->ValidateResource(id); |
| 755 return id; | 754 return id; |
| 756 } | 755 } |
| 757 #endif | 756 #endif |
| 758 | 757 |
| 759 void LayerImpl::ValidateQuadResourcesInternal(DrawQuad* quad) const { | 758 void LayerImpl::ValidateQuadResourcesInternal(DrawQuad* quad) const { |
| 760 #if DCHECK_IS_ON() | 759 #if DCHECK_IS_ON() |
| 761 quad->IterateResources( | 760 quad->IterateResources( |
| 762 base::Bind(&ValidateResource, layer_tree_impl_->resource_provider())); | 761 base::Bind(&ValidateResource, layer_tree_impl_->resource_provider())); |
| 763 #endif | 762 #endif |
| (...skipping 877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1641 gfx::Transform scaled_draw_transform = | 1640 gfx::Transform scaled_draw_transform = |
| 1642 draw_properties_.target_space_transform; | 1641 draw_properties_.target_space_transform; |
| 1643 scaled_draw_transform.Scale(SK_MScalar1 / scale, SK_MScalar1 / scale); | 1642 scaled_draw_transform.Scale(SK_MScalar1 / scale, SK_MScalar1 / scale); |
| 1644 gfx::Size scaled_content_bounds = | 1643 gfx::Size scaled_content_bounds = |
| 1645 gfx::ToCeiledSize(gfx::ScaleSize(content_bounds(), scale)); | 1644 gfx::ToCeiledSize(gfx::ScaleSize(content_bounds(), scale)); |
| 1646 return MathUtil::MapEnclosingClippedRect(scaled_draw_transform, | 1645 return MathUtil::MapEnclosingClippedRect(scaled_draw_transform, |
| 1647 gfx::Rect(scaled_content_bounds)); | 1646 gfx::Rect(scaled_content_bounds)); |
| 1648 } | 1647 } |
| 1649 | 1648 |
| 1650 } // namespace cc | 1649 } // namespace cc |
| OLD | NEW |