| OLD | NEW |
| 1 // Copyright 2010 The Chromium Authors. All rights reserved. | 1 // Copyright 2010 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.h" | 5 #include "cc/layers/layer.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/location.h" | 9 #include "base/location.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| 11 #include "base/single_thread_task_runner.h" | 11 #include "base/single_thread_task_runner.h" |
| 12 #include "cc/animation/animation.h" | 12 #include "cc/animation/animation.h" |
| 13 #include "cc/animation/animation_events.h" | 13 #include "cc/animation/animation_events.h" |
| 14 #include "cc/animation/layer_animation_controller.h" | 14 #include "cc/animation/layer_animation_controller.h" |
| 15 #include "cc/layers/layer_impl.h" | 15 #include "cc/layers/layer_impl.h" |
| 16 #include "cc/layers/layer_scroll_client.h" |
| 16 #include "cc/output/copy_output_request.h" | 17 #include "cc/output/copy_output_request.h" |
| 17 #include "cc/output/copy_output_result.h" | 18 #include "cc/output/copy_output_result.h" |
| 18 #include "cc/trees/layer_tree_host.h" | 19 #include "cc/trees/layer_tree_host.h" |
| 19 #include "cc/trees/layer_tree_impl.h" | 20 #include "cc/trees/layer_tree_impl.h" |
| 20 #include "third_party/WebKit/public/platform/WebLayerScrollClient.h" | |
| 21 #include "third_party/skia/include/core/SkImageFilter.h" | 21 #include "third_party/skia/include/core/SkImageFilter.h" |
| 22 #include "ui/gfx/rect_conversions.h" | 22 #include "ui/gfx/rect_conversions.h" |
| 23 | 23 |
| 24 namespace cc { | 24 namespace cc { |
| 25 | 25 |
| 26 static int s_next_layer_id = 1; | 26 static int s_next_layer_id = 1; |
| 27 | 27 |
| 28 scoped_refptr<Layer> Layer::Create() { | 28 scoped_refptr<Layer> Layer::Create() { |
| 29 return make_scoped_refptr(new Layer()); | 29 return make_scoped_refptr(new Layer()); |
| 30 } | 30 } |
| (...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 520 SetNeedsCommit(); | 520 SetNeedsCommit(); |
| 521 } | 521 } |
| 522 | 522 |
| 523 void Layer::SetScrollOffsetFromImplSide(gfx::Vector2d scroll_offset) { | 523 void Layer::SetScrollOffsetFromImplSide(gfx::Vector2d scroll_offset) { |
| 524 DCHECK(IsPropertyChangeAllowed()); | 524 DCHECK(IsPropertyChangeAllowed()); |
| 525 DCHECK(layer_tree_host_ && layer_tree_host_->CommitRequested()); | 525 DCHECK(layer_tree_host_ && layer_tree_host_->CommitRequested()); |
| 526 if (scroll_offset_ == scroll_offset) | 526 if (scroll_offset_ == scroll_offset) |
| 527 return; | 527 return; |
| 528 scroll_offset_ = scroll_offset; | 528 scroll_offset_ = scroll_offset; |
| 529 if (layer_scroll_client_) | 529 if (layer_scroll_client_) |
| 530 layer_scroll_client_->didScroll(); | 530 layer_scroll_client_->DidScroll(); |
| 531 // Note: didScroll() could potentially change the layer structure. | 531 // Note: didScroll() could potentially change the layer structure. |
| 532 // "this" may have been destroyed during the process. | 532 // "this" may have been destroyed during the process. |
| 533 } | 533 } |
| 534 | 534 |
| 535 void Layer::SetMaxScrollOffset(gfx::Vector2d max_scroll_offset) { | 535 void Layer::SetMaxScrollOffset(gfx::Vector2d max_scroll_offset) { |
| 536 DCHECK(IsPropertyChangeAllowed()); | 536 DCHECK(IsPropertyChangeAllowed()); |
| 537 if (max_scroll_offset_ == max_scroll_offset) | 537 if (max_scroll_offset_ == max_scroll_offset) |
| 538 return; | 538 return; |
| 539 max_scroll_offset_ = max_scroll_offset; | 539 max_scroll_offset_ = max_scroll_offset; |
| 540 SetNeedsCommit(); | 540 SetNeedsCommit(); |
| (...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 897 | 897 |
| 898 RenderingStatsInstrumentation* Layer::rendering_stats_instrumentation() const { | 898 RenderingStatsInstrumentation* Layer::rendering_stats_instrumentation() const { |
| 899 return layer_tree_host_->rendering_stats_instrumentation(); | 899 return layer_tree_host_->rendering_stats_instrumentation(); |
| 900 } | 900 } |
| 901 | 901 |
| 902 bool Layer::SupportsLCDText() const { | 902 bool Layer::SupportsLCDText() const { |
| 903 return false; | 903 return false; |
| 904 } | 904 } |
| 905 | 905 |
| 906 } // namespace cc | 906 } // namespace cc |
| OLD | NEW |