| 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 class PaintController; | 68 class PaintController; |
| 69 class ScrollableArea; | 69 class ScrollableArea; |
| 70 class WebCompositorAnimation; | 70 class WebCompositorAnimation; |
| 71 class WebLayer; | 71 class WebLayer; |
| 72 | 72 |
| 73 typedef Vector<GraphicsLayer*, 64> GraphicsLayerVector; | 73 typedef Vector<GraphicsLayer*, 64> GraphicsLayerVector; |
| 74 | 74 |
| 75 // GraphicsLayer is an abstraction for a rendering surface with backing store, | 75 // GraphicsLayer is an abstraction for a rendering surface with backing store, |
| 76 // which may have associated transformation and animations. | 76 // which may have associated transformation and animations. |
| 77 | 77 |
| 78 class PLATFORM_EXPORT GraphicsLayer : public GraphicsContextPainter, public WebC
ompositorAnimationDelegate, public WebLayerScrollClient, public cc::LayerClient
{ | 78 class PLATFORM_EXPORT GraphicsLayer : public GraphicsContextPainter, public WebC
ompositorAnimationDelegate, public WebLayerScrollClient, public cc::LayerClient,
public DisplayItemClient { |
| 79 WTF_MAKE_NONCOPYABLE(GraphicsLayer); USING_FAST_MALLOC(GraphicsLayer); | 79 WTF_MAKE_NONCOPYABLE(GraphicsLayer); USING_FAST_MALLOC(GraphicsLayer); |
| 80 public: | 80 public: |
| 81 static PassOwnPtr<GraphicsLayer> create(GraphicsLayerFactory*, GraphicsLayer
Client*); | 81 static PassOwnPtr<GraphicsLayer> create(GraphicsLayerFactory*, GraphicsLayer
Client*); |
| 82 | 82 |
| 83 ~GraphicsLayer() override; | 83 ~GraphicsLayer() override; |
| 84 | 84 |
| 85 GraphicsLayerClient* client() const { return m_client; } | 85 GraphicsLayerClient* client() const { return m_client; } |
| 86 | 86 |
| 87 GraphicsLayerDebugInfo& debugInfo(); | 87 GraphicsLayerDebugInfo& debugInfo(); |
| 88 | 88 |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 | 186 |
| 187 void setNeedsDisplay(); | 187 void setNeedsDisplay(); |
| 188 // Mark the given rect (in layer coords) as needing display. Never goes deep
. | 188 // Mark the given rect (in layer coords) as needing display. Never goes deep
. |
| 189 void setNeedsDisplayInRect(const IntRect&, PaintInvalidationReason); | 189 void setNeedsDisplayInRect(const IntRect&, PaintInvalidationReason); |
| 190 | 190 |
| 191 void setContentsNeedsDisplay(); | 191 void setContentsNeedsDisplay(); |
| 192 | 192 |
| 193 // If |visualRect| is not nullptr, it contains all pixels within the Graphic
sLayer which might be painted into by | 193 // If |visualRect| is not nullptr, it contains all pixels within the Graphic
sLayer which might be painted into by |
| 194 // the display item client, in coordinate space of the GraphicsLayer. | 194 // the display item client, in coordinate space of the GraphicsLayer. |
| 195 // |visualRect| can be nullptr if we know it's unchanged and PaintController
has cached the previous value. | 195 // |visualRect| can be nullptr if we know it's unchanged and PaintController
has cached the previous value. |
| 196 void invalidateDisplayItemClient(const DisplayItemClientWrapper&, PaintInval
idationReason, const IntRect* visualRect); | 196 void invalidateDisplayItemClient(const DisplayItemClient&, PaintInvalidation
Reason, const IntRect* visualRect); |
| 197 | 197 |
| 198 // Set that the position/size of the contents (image or video). | 198 // Set that the position/size of the contents (image or video). |
| 199 void setContentsRect(const IntRect&); | 199 void setContentsRect(const IntRect&); |
| 200 | 200 |
| 201 // Return true if the animation is handled by the compositing system. If thi
s returns | 201 // Return true if the animation is handled by the compositing system. If thi
s returns |
| 202 // false, the animation will be run by AnimationController. | 202 // false, the animation will be run by AnimationController. |
| 203 // These methods handle both transitions and keyframe animations. | 203 // These methods handle both transitions and keyframe animations. |
| 204 bool addAnimation(PassOwnPtr<WebCompositorAnimation>); | 204 bool addAnimation(PassOwnPtr<WebCompositorAnimation>); |
| 205 void pauseAnimation(int animationId, double /*timeOffset*/); | 205 void pauseAnimation(int animationId, double /*timeOffset*/); |
| 206 void removeAnimation(int animationId); | 206 void removeAnimation(int animationId); |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 scoped_refptr<base::trace_event::ConvertableToTraceFormat> TakeDebugInfo(cc:
:Layer*) override; | 257 scoped_refptr<base::trace_event::ConvertableToTraceFormat> TakeDebugInfo(cc:
:Layer*) override; |
| 258 | 258 |
| 259 PaintController* paintController() override; | 259 PaintController* paintController() override; |
| 260 | 260 |
| 261 // Exposed for tests. | 261 // Exposed for tests. |
| 262 WebLayer* contentsLayer() const { return m_contentsLayer; } | 262 WebLayer* contentsLayer() const { return m_contentsLayer; } |
| 263 | 263 |
| 264 static void setDrawDebugRedFillForTesting(bool); | 264 static void setDrawDebugRedFillForTesting(bool); |
| 265 ContentLayerDelegate* contentLayerDelegateForTesting() const { return m_cont
entLayerDelegate.get(); } | 265 ContentLayerDelegate* contentLayerDelegateForTesting() const { return m_cont
entLayerDelegate.get(); } |
| 266 | 266 |
| 267 DisplayItemClient displayItemClient() const { return toDisplayItemClient(thi
s); } | 267 String debugName() const final { return m_client->debugName(this); } |
| 268 String debugName() const { return m_client->debugName(this); } | |
| 269 | 268 |
| 270 protected: | 269 protected: |
| 271 String debugName(cc::Layer*) const; | 270 String debugName(cc::Layer*) const; |
| 272 | 271 |
| 273 explicit GraphicsLayer(GraphicsLayerClient*); | 272 explicit GraphicsLayer(GraphicsLayerClient*); |
| 274 // GraphicsLayerFactoryChromium that wants to create a GraphicsLayer need to
be friends. | 273 // GraphicsLayerFactoryChromium that wants to create a GraphicsLayer need to
be friends. |
| 275 friend class GraphicsLayerFactoryChromium; | 274 friend class GraphicsLayerFactoryChromium; |
| 276 // for testing | 275 // for testing |
| 277 friend class CompositedLayerMappingTest; | 276 friend class CompositedLayerMappingTest; |
| 278 friend class FakeGraphicsLayerFactory; | 277 friend class FakeGraphicsLayerFactory; |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 }; | 377 }; |
| 379 | 378 |
| 380 } // namespace blink | 379 } // namespace blink |
| 381 | 380 |
| 382 #ifndef NDEBUG | 381 #ifndef NDEBUG |
| 383 // Outside the blink namespace for ease of invocation from gdb. | 382 // Outside the blink namespace for ease of invocation from gdb. |
| 384 void PLATFORM_EXPORT showGraphicsLayerTree(const blink::GraphicsLayer*); | 383 void PLATFORM_EXPORT showGraphicsLayerTree(const blink::GraphicsLayer*); |
| 385 #endif | 384 #endif |
| 386 | 385 |
| 387 #endif // GraphicsLayer_h | 386 #endif // GraphicsLayer_h |
| OLD | NEW |