Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(24)

Side by Side Diff: cc/layers/layer_impl.h

Issue 903273002: Update from https://crrev.com/315085 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/layers/layer_client.h ('k') | cc/layers/layer_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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 #ifndef CC_LAYERS_LAYER_IMPL_H_ 5 #ifndef CC_LAYERS_LAYER_IMPL_H_
6 #define CC_LAYERS_LAYER_IMPL_H_ 6 #define CC_LAYERS_LAYER_IMPL_H_
7 7
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/logging.h" 12 #include "base/logging.h"
13 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
14 #include "base/values.h" 14 #include "base/values.h"
15 #include "cc/animation/animation_delegate.h" 15 #include "cc/animation/animation_delegate.h"
16 #include "cc/animation/layer_animation_controller.h" 16 #include "cc/animation/layer_animation_controller.h"
17 #include "cc/animation/layer_animation_value_observer.h" 17 #include "cc/animation/layer_animation_value_observer.h"
18 #include "cc/animation/layer_animation_value_provider.h" 18 #include "cc/animation/layer_animation_value_provider.h"
19 #include "cc/base/cc_export.h" 19 #include "cc/base/cc_export.h"
20 #include "cc/base/region.h" 20 #include "cc/base/region.h"
21 #include "cc/base/scoped_ptr_vector.h" 21 #include "cc/base/scoped_ptr_vector.h"
22 #include "cc/base/synced_property.h" 22 #include "cc/base/synced_property.h"
23 #include "cc/debug/frame_timing_request.h" 23 #include "cc/debug/frame_timing_request.h"
24 #include "cc/input/input_handler.h" 24 #include "cc/input/input_handler.h"
25 #include "cc/input/scrollbar.h" 25 #include "cc/input/scrollbar.h"
26 #include "cc/layers/draw_properties.h" 26 #include "cc/layers/draw_properties.h"
27 #include "cc/layers/layer_lists.h" 27 #include "cc/layers/layer_lists.h"
28 #include "cc/layers/layer_position_constraint.h" 28 #include "cc/layers/layer_position_constraint.h"
29 #include "cc/layers/render_surface_impl.h" 29 #include "cc/layers/render_surface_impl.h"
30 #include "cc/layers/scroll_blocks_on.h"
30 #include "cc/output/filter_operations.h" 31 #include "cc/output/filter_operations.h"
31 #include "cc/quads/shared_quad_state.h" 32 #include "cc/quads/shared_quad_state.h"
32 #include "cc/resources/resource_provider.h" 33 #include "cc/resources/resource_provider.h"
33 #include "skia/ext/refptr.h" 34 #include "skia/ext/refptr.h"
34 #include "third_party/skia/include/core/SkColor.h" 35 #include "third_party/skia/include/core/SkColor.h"
35 #include "third_party/skia/include/core/SkImageFilter.h" 36 #include "third_party/skia/include/core/SkImageFilter.h"
36 #include "third_party/skia/include/core/SkPicture.h" 37 #include "third_party/skia/include/core/SkPicture.h"
37 #include "ui/gfx/geometry/point3_f.h" 38 #include "ui/gfx/geometry/point3_f.h"
38 #include "ui/gfx/geometry/rect.h" 39 #include "ui/gfx/geometry/rect.h"
39 #include "ui/gfx/geometry/rect_f.h" 40 #include "ui/gfx/geometry/rect_f.h"
40 #include "ui/gfx/geometry/scroll_offset.h" 41 #include "ui/gfx/geometry/scroll_offset.h"
41 #include "ui/gfx/transform.h" 42 #include "ui/gfx/transform.h"
42 43
43 namespace base { 44 namespace base {
44 namespace debug { 45 namespace trace_event {
45 class ConvertableToTraceFormat; 46 class ConvertableToTraceFormat;
46 class TracedValue; 47 class TracedValue;
47 } 48 }
48 49
50 // TODO(ssid): remove these aliases after the tracing clients are moved to the
51 // new trace_event namespace. See crbug.com/451032. ETA: March 2015
52 namespace debug {
53 using ::base::trace_event::ConvertableToTraceFormat;
54 using ::base::trace_event::TracedValue;
55 }
49 class DictionaryValue; 56 class DictionaryValue;
50 } 57 } // namespace base
51 58
52 namespace cc { 59 namespace cc {
53 60
54 class LayerTreeHostImpl; 61 class LayerTreeHostImpl;
55 class LayerTreeImpl; 62 class LayerTreeImpl;
56 class MicroBenchmarkImpl; 63 class MicroBenchmarkImpl;
57 class Occlusion; 64 class Occlusion;
58 template <typename LayerType> 65 template <typename LayerType>
59 class OcclusionTracker; 66 class OcclusionTracker;
60 class RenderPass; 67 class RenderPass;
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 float contents_scale_x() const { return draw_properties_.contents_scale_x; } 399 float contents_scale_x() const { return draw_properties_.contents_scale_x; }
393 float contents_scale_y() const { return draw_properties_.contents_scale_y; } 400 float contents_scale_y() const { return draw_properties_.contents_scale_y; }
394 void SetContentsScale(float contents_scale_x, float contents_scale_y); 401 void SetContentsScale(float contents_scale_x, float contents_scale_y);
395 402
396 void SetScrollOffsetDelegate(ScrollOffsetDelegate* scroll_offset_delegate); 403 void SetScrollOffsetDelegate(ScrollOffsetDelegate* scroll_offset_delegate);
397 void RefreshFromScrollDelegate(); 404 void RefreshFromScrollDelegate();
398 bool IsExternalFlingActive() const; 405 bool IsExternalFlingActive() const;
399 406
400 void SetCurrentScrollOffset(const gfx::ScrollOffset& scroll_offset); 407 void SetCurrentScrollOffset(const gfx::ScrollOffset& scroll_offset);
401 void PushScrollOffsetFromMainThread(const gfx::ScrollOffset& scroll_offset); 408 void PushScrollOffsetFromMainThread(const gfx::ScrollOffset& scroll_offset);
409 // This method is similar to PushScrollOffsetFromMainThread but will cause the
410 // scroll offset given to clobber any scroll changes on the active tree in the
411 // time until this value is pushed to the active tree.
412 void PushScrollOffsetFromMainThreadAndClobberActiveValue(
413 const gfx::ScrollOffset& scroll_offset);
402 gfx::ScrollOffset PullDeltaForMainThread(); 414 gfx::ScrollOffset PullDeltaForMainThread();
403 gfx::ScrollOffset CurrentScrollOffset() const; 415 gfx::ScrollOffset CurrentScrollOffset() const;
404 gfx::ScrollOffset BaseScrollOffset() const; 416 gfx::ScrollOffset BaseScrollOffset() const;
405 gfx::Vector2dF ScrollDelta() const; 417 gfx::Vector2dF ScrollDelta() const;
406 void SetScrollDelta(const gfx::Vector2dF& delta); 418 void SetScrollDelta(const gfx::Vector2dF& delta);
407 419
408 gfx::ScrollOffset MaxScrollOffset() const; 420 gfx::ScrollOffset MaxScrollOffset() const;
409 gfx::ScrollOffset ClampScrollOffsetToLimits(gfx::ScrollOffset offset) const; 421 gfx::ScrollOffset ClampScrollOffsetToLimits(gfx::ScrollOffset offset) const;
410 gfx::Vector2dF ClampScrollToMaxScrollOffset(); 422 gfx::Vector2dF ClampScrollToMaxScrollOffset();
411 void SetScrollbarPosition(ScrollbarLayerImplBase* scrollbar_layer, 423 void SetScrollbarPosition(ScrollbarLayerImplBase* scrollbar_layer,
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 return non_fast_scrollable_region_; 479 return non_fast_scrollable_region_;
468 } 480 }
469 481
470 void SetTouchEventHandlerRegion(const Region& region) { 482 void SetTouchEventHandlerRegion(const Region& region) {
471 touch_event_handler_region_ = region; 483 touch_event_handler_region_ = region;
472 } 484 }
473 const Region& touch_event_handler_region() const { 485 const Region& touch_event_handler_region() const {
474 return touch_event_handler_region_; 486 return touch_event_handler_region_;
475 } 487 }
476 488
489 void SetScrollBlocksOn(ScrollBlocksOn scroll_blocks_on) {
490 scroll_blocks_on_ = scroll_blocks_on;
491 }
492 ScrollBlocksOn scroll_blocks_on() const { return scroll_blocks_on_; }
477 void SetDrawCheckerboardForMissingTiles(bool checkerboard) { 493 void SetDrawCheckerboardForMissingTiles(bool checkerboard) {
478 draw_checkerboard_for_missing_tiles_ = checkerboard; 494 draw_checkerboard_for_missing_tiles_ = checkerboard;
479 } 495 }
480 bool draw_checkerboard_for_missing_tiles() const { 496 bool draw_checkerboard_for_missing_tiles() const {
481 return draw_checkerboard_for_missing_tiles_; 497 return draw_checkerboard_for_missing_tiles_;
482 } 498 }
483 499
484 InputHandler::ScrollStatus TryScroll( 500 InputHandler::ScrollStatus TryScroll(
485 const gfx::PointF& screen_space_point, 501 const gfx::PointF& screen_space_point,
486 InputHandler::ScrollInputType type) const; 502 InputHandler::ScrollInputType type,
503 ScrollBlocksOn effective_block_mode) const;
487 504
488 void SetDoubleSided(bool double_sided); 505 void SetDoubleSided(bool double_sided);
489 bool double_sided() const { return double_sided_; } 506 bool double_sided() const { return double_sided_; }
490 507
491 void SetTransform(const gfx::Transform& transform); 508 void SetTransform(const gfx::Transform& transform);
492 const gfx::Transform& transform() const { return transform_; } 509 const gfx::Transform& transform() const { return transform_; }
493 bool TransformIsAnimating() const; 510 bool TransformIsAnimating() const;
494 bool TransformIsAnimatingOnImplOnly() const; 511 bool TransformIsAnimatingOnImplOnly() const;
495 void SetTransformAndInvertibility(const gfx::Transform& transform, 512 void SetTransformAndInvertibility(const gfx::Transform& transform,
496 bool transform_is_invertible); 513 bool transform_is_invertible);
(...skipping 26 matching lines...) Expand all
523 virtual SimpleEnclosedRegion VisibleContentOpaqueRegion() const; 540 virtual SimpleEnclosedRegion VisibleContentOpaqueRegion() const;
524 541
525 virtual void DidBecomeActive(); 542 virtual void DidBecomeActive();
526 543
527 virtual void DidBeginTracing(); 544 virtual void DidBeginTracing();
528 545
529 // Release resources held by this layer. Called when the output surface 546 // Release resources held by this layer. Called when the output surface
530 // that rendered this layer was lost or a rendering mode switch has occured. 547 // that rendered this layer was lost or a rendering mode switch has occured.
531 virtual void ReleaseResources(); 548 virtual void ReleaseResources();
532 549
550 // Recreate resources that are required after they were released by a
551 // ReleaseResources call.
552 virtual void RecreateResources();
553
533 ScrollbarAnimationController* scrollbar_animation_controller() const { 554 ScrollbarAnimationController* scrollbar_animation_controller() const {
534 return scrollbar_animation_controller_.get(); 555 return scrollbar_animation_controller_.get();
535 } 556 }
536 557
537 typedef std::set<ScrollbarLayerImplBase*> ScrollbarSet; 558 typedef std::set<ScrollbarLayerImplBase*> ScrollbarSet;
538 ScrollbarSet* scrollbars() { return scrollbars_.get(); } 559 ScrollbarSet* scrollbars() { return scrollbars_.get(); }
539 void ClearScrollbars(); 560 void ClearScrollbars();
540 void AddScrollbar(ScrollbarLayerImplBase* layer); 561 void AddScrollbar(ScrollbarLayerImplBase* layer);
541 void RemoveScrollbar(ScrollbarLayerImplBase* layer); 562 void RemoveScrollbar(ScrollbarLayerImplBase* layer);
542 bool HasScrollbar(ScrollbarOrientation orientation) const; 563 bool HasScrollbar(ScrollbarOrientation orientation) const;
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
650 671
651 // Properties synchronized from the associated Layer. 672 // Properties synchronized from the associated Layer.
652 gfx::Point3F transform_origin_; 673 gfx::Point3F transform_origin_;
653 gfx::Size bounds_; 674 gfx::Size bounds_;
654 ScrollOffsetDelegate* scroll_offset_delegate_; 675 ScrollOffsetDelegate* scroll_offset_delegate_;
655 LayerImpl* scroll_clip_layer_; 676 LayerImpl* scroll_clip_layer_;
656 bool scrollable_ : 1; 677 bool scrollable_ : 1;
657 bool should_scroll_on_main_thread_ : 1; 678 bool should_scroll_on_main_thread_ : 1;
658 bool have_wheel_event_handlers_ : 1; 679 bool have_wheel_event_handlers_ : 1;
659 bool have_scroll_event_handlers_ : 1; 680 bool have_scroll_event_handlers_ : 1;
681
682 static_assert(ScrollBlocksOnMax < (1 << 3), "ScrollBlocksOn too big");
683 ScrollBlocksOn scroll_blocks_on_ : 3;
684
660 bool user_scrollable_horizontal_ : 1; 685 bool user_scrollable_horizontal_ : 1;
661 bool user_scrollable_vertical_ : 1; 686 bool user_scrollable_vertical_ : 1;
662 bool stacking_order_changed_ : 1; 687 bool stacking_order_changed_ : 1;
663 // Whether the "back" of this layer should draw. 688 // Whether the "back" of this layer should draw.
664 bool double_sided_ : 1; 689 bool double_sided_ : 1;
665 bool should_flatten_transform_ : 1; 690 bool should_flatten_transform_ : 1;
666 691
667 // Tracks if drawing-related properties have changed since last redraw. 692 // Tracks if drawing-related properties have changed since last redraw.
668 bool layer_property_changed_ : 1; 693 bool layer_property_changed_ : 1;
669 694
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
749 774
750 std::vector<FrameTimingRequest> frame_timing_requests_; 775 std::vector<FrameTimingRequest> frame_timing_requests_;
751 bool frame_timing_requests_dirty_; 776 bool frame_timing_requests_dirty_;
752 777
753 DISALLOW_COPY_AND_ASSIGN(LayerImpl); 778 DISALLOW_COPY_AND_ASSIGN(LayerImpl);
754 }; 779 };
755 780
756 } // namespace cc 781 } // namespace cc
757 782
758 #endif // CC_LAYERS_LAYER_IMPL_H_ 783 #endif // CC_LAYERS_LAYER_IMPL_H_
OLDNEW
« no previous file with comments | « cc/layers/layer_client.h ('k') | cc/layers/layer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698