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

Side by Side Diff: third_party/WebKit/Source/modules/csspaint/CSSPaintImageGeneratorImpl.h

Issue 2941533002: Break StyleImage dependency on LayoutObject (Closed)
Patch Set: Address reviewer comments Created 3 years, 6 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 CSSPaintImageGeneratorImpl_h 5 #ifndef CSSPaintImageGeneratorImpl_h
6 #define CSSPaintImageGeneratorImpl_h 6 #define CSSPaintImageGeneratorImpl_h
7 7
8 #include "core/css/CSSPaintImageGenerator.h" 8 #include "core/css/CSSPaintImageGenerator.h"
9 #include "core/css/cssom/CSSStyleValue.h" 9 #include "core/css/cssom/CSSStyleValue.h"
10 #include "platform/bindings/ScopedPersistent.h" 10 #include "platform/bindings/ScopedPersistent.h"
11 #include "platform/geometry/IntSize.h" 11 #include "platform/geometry/IntSize.h"
12 #include "platform/heap/Handle.h" 12 #include "platform/heap/Handle.h"
13 #include "v8/include/v8.h" 13 #include "v8/include/v8.h"
14 14
15 namespace blink { 15 namespace blink {
16 16
17 class CSSPaintDefinition; 17 class CSSPaintDefinition;
18 class CSSSyntaxDescriptor; 18 class CSSSyntaxDescriptor;
19 class Document; 19 class Document;
20 class Image; 20 class Image;
21 21
22 class CSSPaintImageGeneratorImpl final : public CSSPaintImageGenerator { 22 class CSSPaintImageGeneratorImpl final : public CSSPaintImageGenerator {
23 public: 23 public:
24 static CSSPaintImageGenerator* Create(const String& name, 24 static CSSPaintImageGenerator* Create(const String& name,
25 Document&, 25 const Document&,
26 Observer*); 26 Observer*);
27 ~CSSPaintImageGeneratorImpl() override; 27 ~CSSPaintImageGeneratorImpl() override;
28 28
29 PassRefPtr<Image> Paint(const LayoutObject&, 29 PassRefPtr<Image> Paint(const ImageResourceObserver&,
30 const IntSize&, 30 const IntSize&,
31 const CSSStyleValueVector*) final; 31 const CSSStyleValueVector*) final;
32 const Vector<CSSPropertyID>& NativeInvalidationProperties() const final; 32 const Vector<CSSPropertyID>& NativeInvalidationProperties() const final;
33 const Vector<AtomicString>& CustomInvalidationProperties() const final; 33 const Vector<AtomicString>& CustomInvalidationProperties() const final;
34 bool HasAlpha() const final; 34 bool HasAlpha() const final;
35 const Vector<CSSSyntaxDescriptor>& InputArgumentTypes() const final; 35 const Vector<CSSSyntaxDescriptor>& InputArgumentTypes() const final;
36 bool IsImageGeneratorReady() const final; 36 bool IsImageGeneratorReady() const final;
37 37
38 // Should be called from the PaintWorkletGlobalScope when a javascript class 38 // Should be called from the PaintWorkletGlobalScope when a javascript class
39 // is registered with the same name. 39 // is registered with the same name.
40 void SetDefinition(CSSPaintDefinition*); 40 void SetDefinition(CSSPaintDefinition*);
41 41
42 DECLARE_VIRTUAL_TRACE(); 42 DECLARE_VIRTUAL_TRACE();
43 43
44 private: 44 private:
45 CSSPaintImageGeneratorImpl(Observer*); 45 CSSPaintImageGeneratorImpl(Observer*);
46 CSSPaintImageGeneratorImpl(CSSPaintDefinition*); 46 CSSPaintImageGeneratorImpl(CSSPaintDefinition*);
47 47
48 Member<CSSPaintDefinition> definition_; 48 Member<CSSPaintDefinition> definition_;
49 Member<Observer> observer_; 49 Member<Observer> observer_;
50 }; 50 };
51 51
52 } // namespace blink 52 } // namespace blink
53 53
54 #endif // CSSPaintImageGeneratorImpl_h 54 #endif // CSSPaintImageGeneratorImpl_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698