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 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
742 | 742 |
743 void LayerImpl::NoteLayerPropertyChangedForDescendants() { | 743 void LayerImpl::NoteLayerPropertyChangedForDescendants() { |
744 layer_tree_impl()->set_needs_update_draw_properties(); | 744 layer_tree_impl()->set_needs_update_draw_properties(); |
745 for (size_t i = 0; i < children_.size(); ++i) | 745 for (size_t i = 0; i < children_.size(); ++i) |
746 children_[i]->NoteLayerPropertyChangedForDescendantsInternal(); | 746 children_[i]->NoteLayerPropertyChangedForDescendantsInternal(); |
747 SetNeedsPushProperties(); | 747 SetNeedsPushProperties(); |
748 } | 748 } |
749 | 749 |
750 #if DCHECK_IS_ON() | 750 #if DCHECK_IS_ON() |
751 // Verify that the resource id is valid. | 751 // Verify that the resource id is valid. |
752 static ResourceProvider::ResourceId ValidateResource( | 752 static ResourceId ValidateResource(const ResourceProvider* provider, |
753 const ResourceProvider* provider, | 753 ResourceId id) { |
754 ResourceProvider::ResourceId id) { | |
755 provider->ValidateResource(id); | 754 provider->ValidateResource(id); |
756 return id; | 755 return id; |
757 } | 756 } |
758 #endif | 757 #endif |
759 | 758 |
760 void LayerImpl::ValidateQuadResourcesInternal(DrawQuad* quad) const { | 759 void LayerImpl::ValidateQuadResourcesInternal(DrawQuad* quad) const { |
761 #if DCHECK_IS_ON() | 760 #if DCHECK_IS_ON() |
762 quad->IterateResources( | 761 quad->IterateResources( |
763 base::Bind(&ValidateResource, layer_tree_impl_->resource_provider())); | 762 base::Bind(&ValidateResource, layer_tree_impl_->resource_provider())); |
764 #endif | 763 #endif |
(...skipping 877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1642 gfx::Transform scaled_draw_transform = | 1641 gfx::Transform scaled_draw_transform = |
1643 draw_properties_.target_space_transform; | 1642 draw_properties_.target_space_transform; |
1644 scaled_draw_transform.Scale(SK_MScalar1 / scale, SK_MScalar1 / scale); | 1643 scaled_draw_transform.Scale(SK_MScalar1 / scale, SK_MScalar1 / scale); |
1645 gfx::Size scaled_content_bounds = | 1644 gfx::Size scaled_content_bounds = |
1646 gfx::ToCeiledSize(gfx::ScaleSize(content_bounds(), scale)); | 1645 gfx::ToCeiledSize(gfx::ScaleSize(content_bounds(), scale)); |
1647 return MathUtil::MapEnclosingClippedRect(scaled_draw_transform, | 1646 return MathUtil::MapEnclosingClippedRect(scaled_draw_transform, |
1648 gfx::Rect(scaled_content_bounds)); | 1647 gfx::Rect(scaled_content_bounds)); |
1649 } | 1648 } |
1650 | 1649 |
1651 } // namespace cc | 1650 } // namespace cc |
OLD | NEW |