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

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

Issue 1390123002: (WIP) Paint property hierarchy approach 1 of 2 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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
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 22 matching lines...) Expand all
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/ContentLayerDelegate.h" 36 #include "platform/graphics/ContentLayerDelegate.h"
37 #include "platform/graphics/GraphicsLayerClient.h" 37 #include "platform/graphics/GraphicsLayerClient.h"
38 #include "platform/graphics/GraphicsLayerDebugInfo.h" 38 #include "platform/graphics/GraphicsLayerDebugInfo.h"
39 #include "platform/graphics/ImageOrientation.h" 39 #include "platform/graphics/ImageOrientation.h"
40 #include "platform/graphics/PaintInvalidationReason.h" 40 #include "platform/graphics/PaintInvalidationReason.h"
41 #include "platform/graphics/filters/FilterOperations.h" 41 #include "platform/graphics/filters/FilterOperations.h"
42 #include "platform/graphics/paint/DisplayItemClient.h" 42 #include "platform/graphics/paint/DisplayItemClient.h"
43 #include "platform/graphics/paint/DisplayItemList.h" 43 #include "platform/graphics/paint/PaintArtifact.h"
44 #include "platform/transforms/TransformationMatrix.h" 44 #include "platform/transforms/TransformationMatrix.h"
45 #include "public/platform/WebCompositorAnimationDelegate.h" 45 #include "public/platform/WebCompositorAnimationDelegate.h"
46 #include "public/platform/WebContentLayer.h" 46 #include "public/platform/WebContentLayer.h"
47 #include "public/platform/WebImageLayer.h" 47 #include "public/platform/WebImageLayer.h"
48 #include "public/platform/WebLayerClient.h" 48 #include "public/platform/WebLayerClient.h"
49 #include "public/platform/WebLayerScrollClient.h" 49 #include "public/platform/WebLayerScrollClient.h"
50 #include "public/platform/WebScrollBlocksOn.h" 50 #include "public/platform/WebScrollBlocksOn.h"
51 #include "third_party/skia/include/core/SkPaint.h" 51 #include "third_party/skia/include/core/SkPaint.h"
52 #include "wtf/OwnPtr.h" 52 #include "wtf/OwnPtr.h"
53 #include "wtf/PassOwnPtr.h" 53 #include "wtf/PassOwnPtr.h"
54 #include "wtf/Vector.h" 54 #include "wtf/Vector.h"
55 55
56 namespace blink { 56 namespace blink {
57 57
58 class DisplayItemList;
59 class FloatRect; 58 class FloatRect;
60 class GraphicsContext; 59 class GraphicsContext;
61 class GraphicsLayer; 60 class GraphicsLayer;
62 class GraphicsLayerFactory; 61 class GraphicsLayerFactory;
63 class GraphicsLayerFactoryChromium; 62 class GraphicsLayerFactoryChromium;
64 class Image; 63 class Image;
65 class LinkHighlight; 64 class LinkHighlight;
66 class JSONObject; 65 class JSONObject;
67 class ScrollableArea; 66 class ScrollableArea;
68 class WebCompositorAnimation; 67 class WebCompositorAnimation;
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 // GraphicsContextPainter implementation. 246 // GraphicsContextPainter implementation.
248 void paint(GraphicsContext&, const IntRect& clip) override; 247 void paint(GraphicsContext&, const IntRect& clip) override;
249 248
250 // WebCompositorAnimationDelegate implementation. 249 // WebCompositorAnimationDelegate implementation.
251 void notifyAnimationStarted(double monotonicTime, int group) override; 250 void notifyAnimationStarted(double monotonicTime, int group) override;
252 void notifyAnimationFinished(double monotonicTime, int group) override; 251 void notifyAnimationFinished(double monotonicTime, int group) override;
253 252
254 // WebLayerScrollClient implementation. 253 // WebLayerScrollClient implementation.
255 void didScroll() override; 254 void didScroll() override;
256 255
257 DisplayItemList* displayItemList() override; 256 PaintArtifact* paintArtifact() override;
257
258 // TODO(pdr): This should be refactored so callers use paintArtifact() direc tly.
259 DisplayItemList* displayItemList() { return &paintArtifact()->displayItemLis t(); }
258 260
259 // Exposed for tests. 261 // Exposed for tests.
260 virtual WebLayer* contentsLayer() const { return m_contentsLayer; } 262 virtual WebLayer* contentsLayer() const { return m_contentsLayer; }
261 263
262 static void setDrawDebugRedFillForTesting(bool); 264 static void setDrawDebugRedFillForTesting(bool);
263 ContentLayerDelegate* contentLayerDelegateForTesting() const { return m_cont entLayerDelegate.get(); } 265 ContentLayerDelegate* contentLayerDelegateForTesting() const { return m_cont entLayerDelegate.get(); }
264 266
265 #ifndef NDEBUG 267 #ifndef NDEBUG
266 DisplayItemClient displayItemClient() const { return toDisplayItemClient(thi s); } 268 DisplayItemClient displayItemClient() const { return toDisplayItemClient(thi s); }
267 String debugName() const { return m_client->debugName(this) + " debug red fi ll"; } 269 String debugName() const { return m_client->debugName(this) + " debug red fi ll"; }
268 #endif 270 #endif
269 271
270 protected: 272 protected:
271 String debugName(WebLayer*) const; 273 String debugName(WebLayer*) const;
272 274
273 explicit GraphicsLayer(GraphicsLayerClient*); 275 explicit GraphicsLayer(GraphicsLayerClient*);
274 // GraphicsLayerFactoryChromium that wants to create a GraphicsLayer need to be friends. 276 // GraphicsLayerFactoryChromium that wants to create a GraphicsLayer need to be friends.
275 friend class GraphicsLayerFactoryChromium; 277 friend class GraphicsLayerFactoryChromium;
276 // for testing 278 // for testing
277 friend class FakeGraphicsLayerFactory; 279 friend class FakeGraphicsLayerFactory;
278 280
279 private: 281 private:
280 // Callback from the underlying graphics system to draw layer contents. 282 // Callback from the underlying graphics system to draw layer contents.
281 void paintGraphicsLayerContents(GraphicsContext&, const IntRect& clip); 283 void paintGraphicsLayerContents(GraphicsContext&, const IntRect& clip);
282 284
283 // Sets m_needsDisplay, but without invalidating the DisplayItemList. This a llows us to test 285 // Sets m_needsDisplay, but without invalidating the PaintArtifact. This all ows us to test
284 // scenarios where paint needs to be re-calculated, but no DisplayItemClient s were invalidated 286 // scenarios where paint needs to be re-calculated, but no invalidations occ urred
285 // (such as re-paints due to change of interest rect). 287 // (such as re-paints due to change of interest rect).
286 void setNeedsDisplayWithoutInvalidateForTesting(); 288 void setNeedsDisplayWithoutInvalidateForTesting();
287 289
288 // Adds a child without calling updateChildList(), so that adding children 290 // Adds a child without calling updateChildList(), so that adding children
289 // can be batched before updating. 291 // can be batched before updating.
290 void addChildInternal(GraphicsLayer*); 292 void addChildInternal(GraphicsLayer*);
291 293
292 #if ENABLE(ASSERT) 294 #if ENABLE(ASSERT)
293 bool hasAncestor(GraphicsLayer*) const; 295 bool hasAncestor(GraphicsLayer*) const;
294 #endif 296 #endif
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 int m_contentsLayerId; 370 int m_contentsLayerId;
369 371
370 Vector<LinkHighlight*> m_linkHighlights; 372 Vector<LinkHighlight*> m_linkHighlights;
371 373
372 OwnPtr<ContentLayerDelegate> m_contentLayerDelegate; 374 OwnPtr<ContentLayerDelegate> m_contentLayerDelegate;
373 375
374 ScrollableArea* m_scrollableArea; 376 ScrollableArea* m_scrollableArea;
375 GraphicsLayerDebugInfo m_debugInfo; 377 GraphicsLayerDebugInfo m_debugInfo;
376 int m_3dRenderingContext; 378 int m_3dRenderingContext;
377 379
378 OwnPtr<DisplayItemList> m_displayItemList; 380 OwnPtr<PaintArtifact> m_paintArtifact;
379 381
380 friend class DisplayItemListPaintTestForSlimmingPaintV2; 382 friend class DisplayItemListPaintTestForSlimmingPaintV2;
381 }; 383 };
382 384
383 } // namespace blink 385 } // namespace blink
384 386
385 #ifndef NDEBUG 387 #ifndef NDEBUG
386 // Outside the blink namespace for ease of invocation from gdb. 388 // Outside the blink namespace for ease of invocation from gdb.
387 void PLATFORM_EXPORT showGraphicsLayerTree(const blink::GraphicsLayer*); 389 void PLATFORM_EXPORT showGraphicsLayerTree(const blink::GraphicsLayer*);
388 #endif 390 #endif
389 391
390 #endif // GraphicsLayer_h 392 #endif // GraphicsLayer_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698