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

Side by Side Diff: third_party/WebKit/Source/core/css/CSSPaintImageGenerator.h

Issue 1866623002: Hook up CSSPaintValue::image to CSS Paint API callback. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed comments Created 4 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CSSPaintImageGenerator_h
6 #define CSSPaintImageGenerator_h
7
8 #include "core/CoreExport.h"
9 #include "platform/geometry/IntSize.h"
10 #include "platform/heap/Handle.h"
11
12 namespace blink {
13
14 class Document;
15 class Image;
16
17 // Produces a PaintGeneratedImage from a CSS Paint API callback.
18 // https://drafts.css-houdini.org/css-paint-api/
19 class CORE_EXPORT CSSPaintImageGenerator : public GarbageCollectedFinalized<CSSP aintImageGenerator> {
20 public:
21 // This observer is used if the paint worklet doesn't have a javascript
22 // class registered with the correct name yet.
23 // paintImageGeneratorReady is called when the javascript class is
24 // registered and ready to use.
25 class Observer {
26 public:
27 virtual ~Observer() { };
28 virtual void paintImageGeneratorReady() = 0;
29 };
30
31 static CSSPaintImageGenerator* create(const String& name, Document&, Observe r*);
32 virtual ~CSSPaintImageGenerator();
33
34 typedef CSSPaintImageGenerator* (*CSSPaintImageGeneratorCreateFunction)(cons t String&, Document&, Observer*);
35 static void init(CSSPaintImageGeneratorCreateFunction);
36
37 // Invokes the CSS Paint API 'paint' callback. May return a nullptr
38 // representing an invalid image if an error occurred.
39 virtual PassRefPtr<Image> paint(const IntSize&) = 0;
40
41 DEFINE_INLINE_VIRTUAL_TRACE() { }
42 };
43
44 } // namespace blink
45
46 #endif // CSSPaintImageGenerator_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698