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

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

Issue 2523673004: [NOT FOR COMMIT] Fully replace SkCanvas uses.
Patch Set: Support Android build. Created 4 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 // 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 "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "platform/PlatformExport.h" 9 #include "platform/PlatformExport.h"
10 #include "platform/RuntimeEnabledFeatures.h" 10 #include "platform/RuntimeEnabledFeatures.h"
11 #include "platform/geometry/FloatPoint.h" 11 #include "platform/geometry/FloatPoint.h"
12 #include "platform/graphics/paint/DisplayItem.h" 12 #include "platform/graphics/paint/DisplayItem.h"
13 #include "third_party/skia/include/core/SkPicture.h" 13 #include "skia/ext/cdl_picture.h"
14 #include "third_party/skia/include/core/SkRefCnt.h" 14 #include "third_party/skia/include/core/SkRefCnt.h"
15 15
16 namespace blink { 16 namespace blink {
17 17
18 class PLATFORM_EXPORT DrawingDisplayItem final : public DisplayItem { 18 class PLATFORM_EXPORT DrawingDisplayItem final : public DisplayItem {
19 public: 19 public:
20 DISABLE_CFI_PERF 20 DISABLE_CFI_PERF
21 DrawingDisplayItem(const DisplayItemClient& client, 21 DrawingDisplayItem(const DisplayItemClient& client,
22 Type type, 22 Type type,
23 sk_sp<const SkPicture> picture, 23 sk_sp<const CdlPicture> picture,
24 bool knownToBeOpaque = false) 24 bool knownToBeOpaque = false)
25 : DisplayItem(client, type, sizeof(*this)), 25 : DisplayItem(client, type, sizeof(*this)),
26 m_picture(picture && picture->approximateOpCount() ? std::move(picture) 26 m_picture(picture && picture->approximateOpCount() ? std::move(picture)
27 : nullptr), 27 : nullptr),
28 m_knownToBeOpaque(knownToBeOpaque) { 28 m_knownToBeOpaque(knownToBeOpaque) {
29 DCHECK(isDrawingType(type)); 29 DCHECK(isDrawingType(type));
30 } 30 }
31 31
32 void replay(GraphicsContext&) const override; 32 void replay(GraphicsContext&) const override;
33 void appendToWebDisplayItemList(const IntRect&, 33 void appendToWebDisplayItemList(const IntRect&,
34 WebDisplayItemList*) const override; 34 WebDisplayItemList*) const override;
35 bool drawsContent() const override; 35 bool drawsContent() const override;
36 36
37 const SkPicture* picture() const { return m_picture.get(); } 37 const CdlPicture* picture() const { return m_picture.get(); }
38 38
39 bool knownToBeOpaque() const { 39 bool knownToBeOpaque() const {
40 DCHECK(RuntimeEnabledFeatures::slimmingPaintV2Enabled()); 40 DCHECK(RuntimeEnabledFeatures::slimmingPaintV2Enabled());
41 return m_knownToBeOpaque; 41 return m_knownToBeOpaque;
42 } 42 }
43 43
44 void analyzeForGpuRasterization(SkPictureGpuAnalyzer&) const override; 44 void analyzeForGpuRasterization(SkPictureGpuAnalyzer&) const override;
45 45
46 private: 46 private:
47 #ifndef NDEBUG 47 #ifndef NDEBUG
48 void dumpPropertiesAsDebugString(WTF::StringBuilder&) const override; 48 void dumpPropertiesAsDebugString(WTF::StringBuilder&) const override;
49 #endif 49 #endif
50 bool equals(const DisplayItem& other) const final; 50 bool equals(const DisplayItem& other) const final;
51 51
52 sk_sp<const SkPicture> m_picture; 52 sk_sp<const CdlPicture> m_picture;
53 53
54 // True if there are no transparent areas. Only used for SlimmingPaintV2. 54 // True if there are no transparent areas. Only used for SlimmingPaintV2.
55 const bool m_knownToBeOpaque; 55 const bool m_knownToBeOpaque;
56 }; 56 };
57 57
58 } // namespace blink 58 } // namespace blink
59 59
60 #endif // DrawingDisplayItem_h 60 #endif // DrawingDisplayItem_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698