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

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

Issue 1497873002: Make DisplayItemClient an interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years 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
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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 void setElementId(uint64_t); 264 void setElementId(uint64_t);
265 void setCompositorMutableProperties(uint32_t); 265 void setCompositorMutableProperties(uint32_t);
266 266
267 static void setDrawDebugRedFillForTesting(bool); 267 static void setDrawDebugRedFillForTesting(bool);
268 ContentLayerDelegate* contentLayerDelegateForTesting() const { return m_cont entLayerDelegate.get(); } 268 ContentLayerDelegate* contentLayerDelegateForTesting() const { return m_cont entLayerDelegate.get(); }
269 269
270 DisplayItemClient displayItemClient() const { return toDisplayItemClient(thi s); } 270 String debugName() const final { return m_client->debugName(this); }
271 String debugName() const { return m_client->debugName(this); }
272 271
273 protected: 272 protected:
274 String debugName(cc::Layer*) const; 273 String debugName(cc::Layer*) const;
275 274
276 explicit GraphicsLayer(GraphicsLayerClient*); 275 explicit GraphicsLayer(GraphicsLayerClient*);
277 // GraphicsLayerFactoryChromium that wants to create a GraphicsLayer need to be friends. 276 // GraphicsLayerFactoryChromium that wants to create a GraphicsLayer need to be friends.
278 friend class GraphicsLayerFactoryChromium; 277 friend class GraphicsLayerFactoryChromium;
279 // for testing 278 // for testing
280 friend class CompositedLayerMappingTest; 279 friend class CompositedLayerMappingTest;
281 friend class FakeGraphicsLayerFactory; 280 friend class FakeGraphicsLayerFactory;
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 }; 380 };
382 381
383 } // namespace blink 382 } // namespace blink
384 383
385 #ifndef NDEBUG 384 #ifndef NDEBUG
386 // Outside the blink namespace for ease of invocation from gdb. 385 // Outside the blink namespace for ease of invocation from gdb.
387 void PLATFORM_EXPORT showGraphicsLayerTree(const blink::GraphicsLayer*); 386 void PLATFORM_EXPORT showGraphicsLayerTree(const blink::GraphicsLayer*);
388 #endif 387 #endif
389 388
390 #endif // GraphicsLayer_h 389 #endif // GraphicsLayer_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698