| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 #include "public/platform/WebContentLayerClient.h" | 38 #include "public/platform/WebContentLayerClient.h" |
| 39 #include "web/WebExport.h" | 39 #include "web/WebExport.h" |
| 40 | 40 |
| 41 namespace blink { | 41 namespace blink { |
| 42 | 42 |
| 43 class GraphicsLayer; | 43 class GraphicsLayer; |
| 44 class LayoutBoxModelObject; | 44 class LayoutBoxModelObject; |
| 45 class Node; | 45 class Node; |
| 46 class WebContentLayer; | 46 class WebContentLayer; |
| 47 class WebLayer; | 47 class WebLayer; |
| 48 class WebViewImpl; | 48 class WebViewBase; |
| 49 | 49 |
| 50 class WEB_EXPORT LinkHighlightImpl final | 50 class WEB_EXPORT LinkHighlightImpl final |
| 51 : public LinkHighlight, | 51 : public LinkHighlight, |
| 52 public WebContentLayerClient, | 52 public WebContentLayerClient, |
| 53 public CompositorAnimationDelegate, | 53 public CompositorAnimationDelegate, |
| 54 public CompositorAnimationPlayerClient { | 54 public CompositorAnimationPlayerClient { |
| 55 public: | 55 public: |
| 56 static std::unique_ptr<LinkHighlightImpl> Create(Node*, WebViewImpl*); | 56 static std::unique_ptr<LinkHighlightImpl> Create(Node*, WebViewBase*); |
| 57 ~LinkHighlightImpl() override; | 57 ~LinkHighlightImpl() override; |
| 58 | 58 |
| 59 WebContentLayer* ContentLayer(); | 59 WebContentLayer* ContentLayer(); |
| 60 WebLayer* ClipLayer(); | 60 WebLayer* ClipLayer(); |
| 61 void StartHighlightAnimationIfNeeded(); | 61 void StartHighlightAnimationIfNeeded(); |
| 62 void UpdateGeometry(); | 62 void UpdateGeometry(); |
| 63 | 63 |
| 64 // WebContentLayerClient implementation. | 64 // WebContentLayerClient implementation. |
| 65 gfx::Rect PaintableRegion() override; | 65 gfx::Rect PaintableRegion() override; |
| 66 void PaintContents(WebDisplayItemList*, | 66 void PaintContents(WebDisplayItemList*, |
| (...skipping 10 matching lines...) Expand all Loading... |
| 77 void ClearCurrentGraphicsLayer() override; | 77 void ClearCurrentGraphicsLayer() override; |
| 78 | 78 |
| 79 // CompositorAnimationPlayerClient implementation. | 79 // CompositorAnimationPlayerClient implementation. |
| 80 CompositorAnimationPlayer* CompositorPlayer() const override; | 80 CompositorAnimationPlayer* CompositorPlayer() const override; |
| 81 | 81 |
| 82 GraphicsLayer* CurrentGraphicsLayerForTesting() const { | 82 GraphicsLayer* CurrentGraphicsLayerForTesting() const { |
| 83 return current_graphics_layer_; | 83 return current_graphics_layer_; |
| 84 } | 84 } |
| 85 | 85 |
| 86 private: | 86 private: |
| 87 LinkHighlightImpl(Node*, WebViewImpl*); | 87 LinkHighlightImpl(Node*, WebViewBase*); |
| 88 | 88 |
| 89 void ReleaseResources(); | 89 void ReleaseResources(); |
| 90 void ComputeQuads(const Node&, Vector<FloatQuad>&) const; | 90 void ComputeQuads(const Node&, Vector<FloatQuad>&) const; |
| 91 | 91 |
| 92 void AttachLinkHighlightToCompositingLayer( | 92 void AttachLinkHighlightToCompositingLayer( |
| 93 const LayoutBoxModelObject& paint_invalidation_container); | 93 const LayoutBoxModelObject& paint_invalidation_container); |
| 94 void ClearGraphicsLayerLinkHighlightPointer(); | 94 void ClearGraphicsLayerLinkHighlightPointer(); |
| 95 // This function computes the highlight path, and returns true if it has | 95 // This function computes the highlight path, and returns true if it has |
| 96 // changed size since the last call to this function. | 96 // changed size since the last call to this function. |
| 97 bool ComputeHighlightLayerPathAndPosition(const LayoutBoxModelObject&); | 97 bool ComputeHighlightLayerPathAndPosition(const LayoutBoxModelObject&); |
| 98 | 98 |
| 99 std::unique_ptr<WebContentLayer> content_layer_; | 99 std::unique_ptr<WebContentLayer> content_layer_; |
| 100 std::unique_ptr<WebLayer> clip_layer_; | 100 std::unique_ptr<WebLayer> clip_layer_; |
| 101 Path path_; | 101 Path path_; |
| 102 | 102 |
| 103 Persistent<Node> node_; | 103 Persistent<Node> node_; |
| 104 WebViewImpl* owning_web_view_impl_; | 104 WebViewBase* owning_web_view_; |
| 105 GraphicsLayer* current_graphics_layer_; | 105 GraphicsLayer* current_graphics_layer_; |
| 106 bool is_scrolling_graphics_layer_; | 106 bool is_scrolling_graphics_layer_; |
| 107 std::unique_ptr<CompositorAnimationPlayer> compositor_player_; | 107 std::unique_ptr<CompositorAnimationPlayer> compositor_player_; |
| 108 | 108 |
| 109 bool geometry_needs_update_; | 109 bool geometry_needs_update_; |
| 110 bool is_animating_; | 110 bool is_animating_; |
| 111 double start_time_; | 111 double start_time_; |
| 112 }; | 112 }; |
| 113 | 113 |
| 114 } // namespace blink | 114 } // namespace blink |
| 115 | 115 |
| 116 #endif // LinkHighlightImpl_h | 116 #endif // LinkHighlightImpl_h |
| OLD | NEW |