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

Side by Side Diff: Source/platform/graphics/GraphicsLayer.h

Issue 412123002: Rename WebAnimation to WebCompositorAnimation (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 4 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 | Annotate | Revision Log
OLDNEW
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 20 matching lines...) Expand all
31 #include "platform/geometry/FloatPoint.h" 31 #include "platform/geometry/FloatPoint.h"
32 #include "platform/geometry/FloatPoint3D.h" 32 #include "platform/geometry/FloatPoint3D.h"
33 #include "platform/geometry/FloatSize.h" 33 #include "platform/geometry/FloatSize.h"
34 #include "platform/geometry/IntRect.h" 34 #include "platform/geometry/IntRect.h"
35 #include "platform/graphics/Color.h" 35 #include "platform/graphics/Color.h"
36 #include "platform/graphics/GraphicsLayerClient.h" 36 #include "platform/graphics/GraphicsLayerClient.h"
37 #include "platform/graphics/GraphicsLayerDebugInfo.h" 37 #include "platform/graphics/GraphicsLayerDebugInfo.h"
38 #include "platform/graphics/OpaqueRectTrackingContentLayerDelegate.h" 38 #include "platform/graphics/OpaqueRectTrackingContentLayerDelegate.h"
39 #include "platform/graphics/filters/FilterOperations.h" 39 #include "platform/graphics/filters/FilterOperations.h"
40 #include "platform/transforms/TransformationMatrix.h" 40 #include "platform/transforms/TransformationMatrix.h"
41 #include "public/platform/WebAnimationDelegate.h" 41 #include "public/platform/WebCompositorAnimationDelegate.h"
42 #include "public/platform/WebContentLayer.h" 42 #include "public/platform/WebContentLayer.h"
43 #include "public/platform/WebImageLayer.h" 43 #include "public/platform/WebImageLayer.h"
44 #include "public/platform/WebLayerClient.h" 44 #include "public/platform/WebLayerClient.h"
45 #include "public/platform/WebLayerScrollClient.h" 45 #include "public/platform/WebLayerScrollClient.h"
46 #include "public/platform/WebNinePatchLayer.h" 46 #include "public/platform/WebNinePatchLayer.h"
47 #include "wtf/OwnPtr.h" 47 #include "wtf/OwnPtr.h"
48 #include "wtf/PassOwnPtr.h" 48 #include "wtf/PassOwnPtr.h"
49 #include "wtf/Vector.h" 49 #include "wtf/Vector.h"
50 50
51 namespace blink { 51 namespace blink {
52 52
53 class FloatRect; 53 class FloatRect;
54 class GraphicsContext; 54 class GraphicsContext;
55 class GraphicsLayer; 55 class GraphicsLayer;
56 class GraphicsLayerFactory; 56 class GraphicsLayerFactory;
57 class GraphicsLayerFactoryChromium; 57 class GraphicsLayerFactoryChromium;
58 class Image; 58 class Image;
59 class JSONObject; 59 class JSONObject;
60 class ScrollableArea; 60 class ScrollableArea;
61 class TextStream; 61 class TextStream;
62 class WebAnimation; 62 class WebCompositorAnimation;
63 class WebLayer; 63 class WebLayer;
64 64
65 // FIXME: find a better home for this declaration. 65 // FIXME: find a better home for this declaration.
66 class PLATFORM_EXPORT LinkHighlightClient { 66 class PLATFORM_EXPORT LinkHighlightClient {
67 public: 67 public:
68 virtual void invalidate() = 0; 68 virtual void invalidate() = 0;
69 virtual void clearCurrentGraphicsLayer() = 0; 69 virtual void clearCurrentGraphicsLayer() = 0;
70 virtual WebLayer* layer() = 0; 70 virtual WebLayer* layer() = 0;
71 71
72 protected: 72 protected:
73 virtual ~LinkHighlightClient() { } 73 virtual ~LinkHighlightClient() { }
74 }; 74 };
75 75
76 typedef Vector<GraphicsLayer*, 64> GraphicsLayerVector; 76 typedef Vector<GraphicsLayer*, 64> GraphicsLayerVector;
77 77
78 // GraphicsLayer is an abstraction for a rendering surface with backing store, 78 // GraphicsLayer is an abstraction for a rendering surface with backing store,
79 // which may have associated transformation and animations. 79 // which may have associated transformation and animations.
80 80
81 class PLATFORM_EXPORT GraphicsLayer : public GraphicsContextPainter, public WebA nimationDelegate, public WebLayerScrollClient, public WebLayerClient { 81 class PLATFORM_EXPORT GraphicsLayer : public GraphicsContextPainter, public WebC ompositorAnimationDelegate, public WebLayerScrollClient, public WebLayerClient {
82 WTF_MAKE_NONCOPYABLE(GraphicsLayer); WTF_MAKE_FAST_ALLOCATED; 82 WTF_MAKE_NONCOPYABLE(GraphicsLayer); WTF_MAKE_FAST_ALLOCATED;
83 public: 83 public:
84 static PassOwnPtr<GraphicsLayer> create(GraphicsLayerFactory*, GraphicsLayer Client*); 84 static PassOwnPtr<GraphicsLayer> create(GraphicsLayerFactory*, GraphicsLayer Client*);
85 85
86 virtual ~GraphicsLayer(); 86 virtual ~GraphicsLayer();
87 87
88 GraphicsLayerClient* client() const { return m_client; } 88 GraphicsLayerClient* client() const { return m_client; }
89 89
90 // WebLayerClient implementation. 90 // WebLayerClient implementation.
91 virtual WebGraphicsLayerDebugInfo* takeDebugInfoFor(WebLayer*) OVERRIDE; 91 virtual WebGraphicsLayerDebugInfo* takeDebugInfoFor(WebLayer*) OVERRIDE;
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 void setNeedsDisplayInRect(const FloatRect&); 186 void setNeedsDisplayInRect(const FloatRect&);
187 187
188 void setContentsNeedsDisplay(); 188 void setContentsNeedsDisplay();
189 189
190 // Set that the position/size of the contents (image or video). 190 // Set that the position/size of the contents (image or video).
191 void setContentsRect(const IntRect&); 191 void setContentsRect(const IntRect&);
192 192
193 // Return true if the animation is handled by the compositing system. If thi s returns 193 // Return true if the animation is handled by the compositing system. If thi s returns
194 // false, the animation will be run by AnimationController. 194 // false, the animation will be run by AnimationController.
195 // These methods handle both transitions and keyframe animations. 195 // These methods handle both transitions and keyframe animations.
196 bool addAnimation(PassOwnPtr<WebAnimation>); 196 bool addAnimation(PassOwnPtr<WebCompositorAnimation>);
197 void pauseAnimation(int animationId, double /*timeOffset*/); 197 void pauseAnimation(int animationId, double /*timeOffset*/);
198 void removeAnimation(int animationId); 198 void removeAnimation(int animationId);
199 199
200 // Layer contents 200 // Layer contents
201 void setContentsToImage(Image*); 201 void setContentsToImage(Image*);
202 void setContentsToNinePatch(Image*, const IntRect& aperture); 202 void setContentsToNinePatch(Image*, const IntRect& aperture);
203 void setContentsToPlatformLayer(WebLayer* layer) { setContentsTo(layer); } 203 void setContentsToPlatformLayer(WebLayer* layer) { setContentsTo(layer); }
204 bool hasContentsLayer() const { return m_contentsLayer; } 204 bool hasContentsLayer() const { return m_contentsLayer; }
205 205
206 // For hosting this GraphicsLayer in a native layer hierarchy. 206 // For hosting this GraphicsLayer in a native layer hierarchy.
(...skipping 21 matching lines...) Expand all
228 ScrollableArea* scrollableArea() const { return m_scrollableArea; } 228 ScrollableArea* scrollableArea() const { return m_scrollableArea; }
229 229
230 WebContentLayer* contentLayer() const { return m_layer.get(); } 230 WebContentLayer* contentLayer() const { return m_layer.get(); }
231 231
232 static void registerContentsLayer(WebLayer*); 232 static void registerContentsLayer(WebLayer*);
233 static void unregisterContentsLayer(WebLayer*); 233 static void unregisterContentsLayer(WebLayer*);
234 234
235 // GraphicsContextPainter implementation. 235 // GraphicsContextPainter implementation.
236 virtual void paint(GraphicsContext&, const IntRect& clip) OVERRIDE; 236 virtual void paint(GraphicsContext&, const IntRect& clip) OVERRIDE;
237 237
238 // WebAnimationDelegate implementation. 238 // WebCompositorAnimationDelegate implementation.
239 virtual void notifyAnimationStarted(double monotonicTime, WebAnimation::Targ etProperty) OVERRIDE; 239 virtual void notifyAnimationStarted(double monotonicTime, WebCompositorAnima tion::TargetProperty) OVERRIDE;
240 virtual void notifyAnimationFinished(double monotonicTime, WebAnimation::Tar getProperty) OVERRIDE; 240 virtual void notifyAnimationFinished(double monotonicTime, WebCompositorAnim ation::TargetProperty) OVERRIDE;
241 241
242 // WebLayerScrollClient implementation. 242 // WebLayerScrollClient implementation.
243 virtual void didScroll() OVERRIDE; 243 virtual void didScroll() OVERRIDE;
244 244
245 protected: 245 protected:
246 String debugName(WebLayer*) const; 246 String debugName(WebLayer*) const;
247 247
248 explicit GraphicsLayer(GraphicsLayerClient*); 248 explicit GraphicsLayer(GraphicsLayerClient*);
249 // GraphicsLayerFactoryChromium that wants to create a GraphicsLayer need to be friends. 249 // GraphicsLayerFactoryChromium that wants to create a GraphicsLayer need to be friends.
250 friend class GraphicsLayerFactoryChromium; 250 friend class GraphicsLayerFactoryChromium;
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 }; 344 };
345 345
346 } // namespace blink 346 } // namespace blink
347 347
348 #ifndef NDEBUG 348 #ifndef NDEBUG
349 // Outside the WebCore namespace for ease of invocation from gdb. 349 // Outside the WebCore namespace for ease of invocation from gdb.
350 void PLATFORM_EXPORT showGraphicsLayerTree(const blink::GraphicsLayer*); 350 void PLATFORM_EXPORT showGraphicsLayerTree(const blink::GraphicsLayer*);
351 #endif 351 #endif
352 352
353 #endif // GraphicsLayer_h 353 #endif // GraphicsLayer_h
OLDNEW
« no previous file with comments | « Source/core/animation/CompositorAnimationsTestHelper.h ('k') | Source/platform/graphics/GraphicsLayer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698