summaryrefslogtreecommitdiff
path: root/chromium/third_party/blink/renderer/modules/csspaint/paint_worklet.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/blink/renderer/modules/csspaint/paint_worklet.h')
-rw-r--r--chromium/third_party/blink/renderer/modules/csspaint/paint_worklet.h17
1 files changed, 8 insertions, 9 deletions
diff --git a/chromium/third_party/blink/renderer/modules/csspaint/paint_worklet.h b/chromium/third_party/blink/renderer/modules/csspaint/paint_worklet.h
index aa6459aa17a..791459e8440 100644
--- a/chromium/third_party/blink/renderer/modules/csspaint/paint_worklet.h
+++ b/chromium/third_party/blink/renderer/modules/csspaint/paint_worklet.h
@@ -29,17 +29,18 @@ class MODULES_EXPORT PaintWorklet : public Worklet,
static const char kSupplementName[];
// At this moment, paint worklet allows at most two global scopes at any time.
- static const size_t kNumGlobalScopes;
+ static const wtf_size_t kNumGlobalScopes;
static PaintWorklet* From(LocalDOMWindow&);
static PaintWorklet* Create(LocalFrame*);
+ explicit PaintWorklet(LocalFrame*);
~PaintWorklet() override;
void AddPendingGenerator(const String& name, CSSPaintImageGeneratorImpl*);
- // The |container_size| is the container size with subpixel snapping.
+ // The |container_size| is without subpixel snapping.
scoped_refptr<Image> Paint(const String& name,
const ImageResourceObserver&,
- const IntSize& container_size,
+ const FloatSize& container_size,
const CSSStyleValueVector*);
typedef HeapHashMap<String, Member<DocumentPaintDefinition>>
@@ -50,12 +51,10 @@ class MODULES_EXPORT PaintWorklet : public Worklet,
void Trace(blink::Visitor*) override;
protected:
- explicit PaintWorklet(LocalFrame*);
-
// Since paint worklet has more than one global scope, we MUST override this
// function and provide our own selection logic.
- size_t SelectGlobalScope() final;
- size_t GetActiveGlobalScopeForTesting() { return active_global_scope_; }
+ wtf_size_t SelectGlobalScope() final;
+ wtf_size_t GetActiveGlobalScopeForTesting() { return active_global_scope_; }
private:
friend class PaintWorkletTest;
@@ -68,7 +67,7 @@ class MODULES_EXPORT PaintWorklet : public Worklet,
// global scopes.
virtual int GetPaintsBeforeSwitching();
// This function calculates the next global scope to switch to.
- virtual size_t SelectNewGlobalScope();
+ virtual wtf_size_t SelectNewGlobalScope();
Member<PaintWorkletPendingGeneratorRegistry> pending_generator_registry_;
DocumentDefinitionMap document_definition_map_;
@@ -77,7 +76,7 @@ class MODULES_EXPORT PaintWorklet : public Worklet,
// tell when we begin painting on a new frame.
size_t active_frame_count_ = 0u;
// The current global scope being used for painting.
- size_t active_global_scope_ = 0u;
+ wtf_size_t active_global_scope_ = 0u;
// The number of paint calls remaining before Paint will select a new global
// scope. SelectGlobalScope resets this at the beginning of each frame.
int paints_before_switching_global_scope_;