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

Side by Side Diff: Source/platform/graphics/paint/DrawingDisplayItem.h

Issue 924533006: Don't remove empty display item pairs that draw content (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Address review comments Created 5 years, 10 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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 DrawingDisplayItem_h 5 #ifndef DrawingDisplayItem_h
6 #define DrawingDisplayItem_h 6 #define DrawingDisplayItem_h
7 7
8 #include "platform/PlatformExport.h" 8 #include "platform/PlatformExport.h"
9 #include "platform/geometry/FloatPoint.h" 9 #include "platform/geometry/FloatPoint.h"
10 #include "platform/graphics/paint/DisplayItem.h" 10 #include "platform/graphics/paint/DisplayItem.h"
11 #include "third_party/skia/include/core/SkPicture.h" 11 #include "third_party/skia/include/core/SkPicture.h"
12 #include "wtf/PassOwnPtr.h" 12 #include "wtf/PassOwnPtr.h"
13 13
14 namespace blink { 14 namespace blink {
15 15
16 class PLATFORM_EXPORT DrawingDisplayItem : public DisplayItem { 16 class PLATFORM_EXPORT DrawingDisplayItem : public DisplayItem {
17 public: 17 public:
18 static PassOwnPtr<DrawingDisplayItem> create(DisplayItemClient client, Type type, PassRefPtr<const SkPicture> picture) 18 static PassOwnPtr<DrawingDisplayItem> create(DisplayItemClient client, Type type, PassRefPtr<const SkPicture> picture)
19 { 19 {
20 return adoptPtr(new DrawingDisplayItem(client, type, picture)); 20 return adoptPtr(new DrawingDisplayItem(client, type, picture));
21 } 21 }
22 22
23 virtual void replay(GraphicsContext*); 23 virtual void replay(GraphicsContext*);
24 virtual void appendToWebDisplayItemList(WebDisplayItemList*) const override; 24 virtual void appendToWebDisplayItemList(WebDisplayItemList*) const override;
25 virtual bool drawsContent() const override;
25 26
26 PassRefPtr<const SkPicture> picture() const { return m_picture; } 27 PassRefPtr<const SkPicture> picture() const { return m_picture; }
27 28
28 protected: 29 protected:
29 DrawingDisplayItem(DisplayItemClient client, Type type, PassRefPtr<const SkP icture> picture) 30 DrawingDisplayItem(DisplayItemClient client, Type type, PassRefPtr<const SkP icture> picture)
30 : DisplayItem(client, type), m_picture(picture) 31 : DisplayItem(client, type), m_picture(picture)
31 { 32 {
32 ASSERT(m_picture); 33 ASSERT(m_picture);
33 ASSERT(isDrawingType(type)); 34 ASSERT(isDrawingType(type));
34 } 35 }
35 36
36 private: 37 private:
37 #ifndef NDEBUG 38 #ifndef NDEBUG
38 virtual void dumpPropertiesAsDebugString(WTF::StringBuilder&) const override ; 39 virtual void dumpPropertiesAsDebugString(WTF::StringBuilder&) const override ;
39 #endif 40 #endif
40 41
41 RefPtr<const SkPicture> m_picture; 42 RefPtr<const SkPicture> m_picture;
42 }; 43 };
43 44
44 } // namespace blink 45 } // namespace blink
45 46
46 #endif // DrawingDisplayItem_h 47 #endif // DrawingDisplayItem_h
OLDNEW
« no previous file with comments | « Source/platform/graphics/paint/DisplayItemList.cpp ('k') | Source/platform/graphics/paint/DrawingDisplayItem.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698