| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2013 Intel Corporation. All rights reserved. | 3 * Copyright (C) 2013 Intel Corporation. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 | 75 |
| 76 protected: | 76 protected: |
| 77 virtual ~LinkHighlightClient() { } | 77 virtual ~LinkHighlightClient() { } |
| 78 }; | 78 }; |
| 79 | 79 |
| 80 typedef Vector<GraphicsLayer*, 64> GraphicsLayerVector; | 80 typedef Vector<GraphicsLayer*, 64> GraphicsLayerVector; |
| 81 | 81 |
| 82 // GraphicsLayer is an abstraction for a rendering surface with backing store, | 82 // GraphicsLayer is an abstraction for a rendering surface with backing store, |
| 83 // which may have associated transformation and animations. | 83 // which may have associated transformation and animations. |
| 84 | 84 |
| 85 class PLATFORM_EXPORT GraphicsLayer : public GraphicsContextPainter, public WebC
ompositorAnimationDelegate, public WebLayerScrollClient, public WebLayerClient { | 85 class PLATFORM_EXPORT GraphicsLayer : public GraphicsContextPainter, public WebL
ayerScrollClient, public WebLayerClient { |
| 86 WTF_MAKE_NONCOPYABLE(GraphicsLayer); WTF_MAKE_FAST_ALLOCATED(GraphicsLayer); | 86 WTF_MAKE_NONCOPYABLE(GraphicsLayer); WTF_MAKE_FAST_ALLOCATED(GraphicsLayer); |
| 87 public: | 87 public: |
| 88 static PassOwnPtr<GraphicsLayer> create(GraphicsLayerFactory*, GraphicsLayer
Client*); | 88 static PassOwnPtr<GraphicsLayer> create(GraphicsLayerFactory*, GraphicsLayer
Client*); |
| 89 | 89 |
| 90 virtual ~GraphicsLayer(); | 90 virtual ~GraphicsLayer(); |
| 91 | 91 |
| 92 GraphicsLayerClient* client() const { return m_client; } | 92 GraphicsLayerClient* client() const { return m_client; } |
| 93 | 93 |
| 94 // WebLayerClient implementation. | 94 // WebLayerClient implementation. |
| 95 virtual WebGraphicsLayerDebugInfo* takeDebugInfoFor(WebLayer*) override; | 95 virtual WebGraphicsLayerDebugInfo* takeDebugInfoFor(WebLayer*) override; |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 // Mark the given rect (in layer coords) as needing display. Never goes deep
. | 197 // Mark the given rect (in layer coords) as needing display. Never goes deep
. |
| 198 void setNeedsDisplayInRect(const IntRect&, PaintInvalidationReason); | 198 void setNeedsDisplayInRect(const IntRect&, PaintInvalidationReason); |
| 199 | 199 |
| 200 void setContentsNeedsDisplay(); | 200 void setContentsNeedsDisplay(); |
| 201 | 201 |
| 202 void invalidateDisplayItemClient(const DisplayItemClientWrapper&); | 202 void invalidateDisplayItemClient(const DisplayItemClientWrapper&); |
| 203 | 203 |
| 204 // Set that the position/size of the contents (image or video). | 204 // Set that the position/size of the contents (image or video). |
| 205 void setContentsRect(const IntRect&); | 205 void setContentsRect(const IntRect&); |
| 206 | 206 |
| 207 // Return true if the animation is handled by the compositing system. If thi
s returns | |
| 208 // false, the animation will be run by AnimationController. | |
| 209 // These methods handle both transitions and keyframe animations. | |
| 210 bool addAnimation(PassOwnPtr<WebCompositorAnimation>); | |
| 211 void pauseAnimation(int animationId, double /*timeOffset*/); | |
| 212 void removeAnimation(int animationId); | |
| 213 | |
| 214 // Layer contents | 207 // Layer contents |
| 215 void setContentsToImage(Image*); | 208 void setContentsToImage(Image*); |
| 216 void setContentsToNinePatch(Image*, const IntRect& aperture); | 209 void setContentsToNinePatch(Image*, const IntRect& aperture); |
| 217 void setContentsToPlatformLayer(WebLayer* layer) { setContentsTo(layer); } | 210 void setContentsToPlatformLayer(WebLayer* layer) { setContentsTo(layer); } |
| 218 bool hasContentsLayer() const { return m_contentsLayer; } | 211 bool hasContentsLayer() const { return m_contentsLayer; } |
| 219 | 212 |
| 220 // For hosting this GraphicsLayer in a native layer hierarchy. | 213 // For hosting this GraphicsLayer in a native layer hierarchy. |
| 221 WebLayer* platformLayer() const; | 214 WebLayer* platformLayer() const; |
| 222 | 215 |
| 223 typedef HashMap<int, int> RenderingContextMap; | 216 typedef HashMap<int, int> RenderingContextMap; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 244 ScrollableArea* scrollableArea() const { return m_scrollableArea; } | 237 ScrollableArea* scrollableArea() const { return m_scrollableArea; } |
| 245 | 238 |
| 246 WebContentLayer* contentLayer() const { return m_layer.get(); } | 239 WebContentLayer* contentLayer() const { return m_layer.get(); } |
| 247 | 240 |
| 248 static void registerContentsLayer(WebLayer*); | 241 static void registerContentsLayer(WebLayer*); |
| 249 static void unregisterContentsLayer(WebLayer*); | 242 static void unregisterContentsLayer(WebLayer*); |
| 250 | 243 |
| 251 // GraphicsContextPainter implementation. | 244 // GraphicsContextPainter implementation. |
| 252 virtual void paint(GraphicsContext&, const IntRect& clip) override; | 245 virtual void paint(GraphicsContext&, const IntRect& clip) override; |
| 253 | 246 |
| 254 // WebCompositorAnimationDelegate implementation. | |
| 255 virtual void notifyAnimationStarted(double monotonicTime, int group) overrid
e; | |
| 256 virtual void notifyAnimationFinished(double monotonicTime, int group) overri
de; | |
| 257 | |
| 258 // WebLayerScrollClient implementation. | 247 // WebLayerScrollClient implementation. |
| 259 virtual void didScroll() override; | 248 virtual void didScroll() override; |
| 260 | 249 |
| 261 virtual DisplayItemList* displayItemList() override; | 250 virtual DisplayItemList* displayItemList() override; |
| 262 | 251 |
| 263 // Exposed for tests. | 252 // Exposed for tests. |
| 264 virtual WebLayer* contentsLayer() const { return m_contentsLayer; } | 253 virtual WebLayer* contentsLayer() const { return m_contentsLayer; } |
| 265 | 254 |
| 266 #ifndef NDEBUG | 255 #ifndef NDEBUG |
| 267 DisplayItemClient displayItemClient() const { return toDisplayItemClient(thi
s); } | 256 DisplayItemClient displayItemClient() const { return toDisplayItemClient(thi
s); } |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 }; | 362 }; |
| 374 | 363 |
| 375 } // namespace blink | 364 } // namespace blink |
| 376 | 365 |
| 377 #ifndef NDEBUG | 366 #ifndef NDEBUG |
| 378 // Outside the blink namespace for ease of invocation from gdb. | 367 // Outside the blink namespace for ease of invocation from gdb. |
| 379 void PLATFORM_EXPORT showGraphicsLayerTree(const blink::GraphicsLayer*); | 368 void PLATFORM_EXPORT showGraphicsLayerTree(const blink::GraphicsLayer*); |
| 380 #endif | 369 #endif |
| 381 | 370 |
| 382 #endif // GraphicsLayer_h | 371 #endif // GraphicsLayer_h |
| OLD | NEW |