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

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

Issue 2791043002: Draw recorded content directly into the containing PaintCanvas, when possible. (Closed)
Patch Set: none Created 3 years, 8 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 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef PaintArtifact_h 5 #ifndef PaintArtifact_h
6 #define PaintArtifact_h 6 #define PaintArtifact_h
7 7
8 #include "platform/PlatformExport.h" 8 #include "platform/PlatformExport.h"
9 #include "platform/graphics/paint/DisplayItemList.h" 9 #include "platform/graphics/paint/DisplayItemList.h"
10 #include "platform/graphics/paint/PaintCanvas.h"
10 #include "platform/graphics/paint/PaintChunk.h" 11 #include "platform/graphics/paint/PaintChunk.h"
11 #include "wtf/Allocator.h" 12 #include "wtf/Allocator.h"
12 #include "wtf/Noncopyable.h" 13 #include "wtf/Noncopyable.h"
13 #include "wtf/Vector.h" 14 #include "wtf/Vector.h"
14 15
15 namespace blink { 16 namespace blink {
16 17
17 class GraphicsContext; 18 class GraphicsContext;
18 class WebDisplayItemList; 19 class WebDisplayItemList;
19 20
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 65
65 // Resets to an empty paint artifact. 66 // Resets to an empty paint artifact.
66 void reset(); 67 void reset();
67 68
68 // Returns the approximate memory usage, excluding memory likely to be 69 // Returns the approximate memory usage, excluding memory likely to be
69 // shared with the embedder after copying to WebDisplayItemList. 70 // shared with the embedder after copying to WebDisplayItemList.
70 size_t approximateUnsharedMemoryUsage() const; 71 size_t approximateUnsharedMemoryUsage() const;
71 72
72 // Draws the paint artifact to a GraphicsContext. 73 // Draws the paint artifact to a GraphicsContext.
73 // |bounds| is the bounding box of the paint artifact's display list. 74 // |bounds| is the bounding box of the paint artifact's display list.
75 void replay(const FloatRect& bounds, GraphicsContext&) const;
76
77 // Draws the paint artifact to a PaintCanvas.
78 // |bounds| is the bounding box of the paint artifact's display list.
79 // SPv2 only.
74 // In SPv2 mode, replays into the ancestor state given by |replayState|. 80 // In SPv2 mode, replays into the ancestor state given by |replayState|.
75 void replay( 81 void replay(
76 const FloatRect& bounds, 82 const FloatRect& bounds,
77 GraphicsContext&, 83 PaintCanvas&,
78 const PropertyTreeState& replayState = PropertyTreeState::root()) const; 84 const PropertyTreeState& replayState = PropertyTreeState::root()) const;
79 85
80 // Writes the paint artifact into a WebDisplayItemList. 86 // Writes the paint artifact into a WebDisplayItemList.
81 void appendToWebDisplayItemList(WebDisplayItemList*) const; 87 void appendToWebDisplayItemList(WebDisplayItemList*) const;
82 88
83 private: 89 private:
84 DisplayItemList m_displayItemList; 90 DisplayItemList m_displayItemList;
85 Vector<PaintChunk> m_paintChunks; 91 Vector<PaintChunk> m_paintChunks;
86 bool m_isSuitableForGpuRasterization; 92 bool m_isSuitableForGpuRasterization;
87 }; 93 };
88 94
89 } // namespace blink 95 } // namespace blink
90 96
91 #endif // PaintArtifact_h 97 #endif // PaintArtifact_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698