chromium/third_party/blink/renderer/modules/csspaint/paint_worklet.cc

// Copyright 2016 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "third_party/blink/renderer/modules/csspaint/paint_worklet.h"

#include "base/rand_util.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_binding_for_core.h"
#include "third_party/blink/renderer/core/css/cssom/prepopulated_computed_style_property_map.h"
#include "third_party/blink/renderer/core/dom/document.h"
#include "third_party/blink/renderer/core/dom/node_rare_data.h"
#include "third_party/blink/renderer/core/frame/local_dom_window.h"
#include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/core/layout/layout_object.h"
#include "third_party/blink/renderer/core/page/page.h"
#include "third_party/blink/renderer/modules/csspaint/css_paint_definition.h"
#include "third_party/blink/renderer/modules/csspaint/paint_worklet_global_scope.h"
#include "third_party/blink/renderer/modules/csspaint/paint_worklet_id_generator.h"
#include "third_party/blink/renderer/modules/csspaint/paint_worklet_messaging_proxy.h"
#include "third_party/blink/renderer/platform/bindings/script_forbidden_scope.h"
#include "third_party/blink/renderer/platform/graphics/paint_generated_image.h"

namespace blink {

const wtf_size_t PaintWorklet::kNumGlobalScopesPerThread =;
const size_t kMaxPaintCountToSwitch =;

// static
PaintWorklet* PaintWorklet::From(LocalDOMWindow& window) {}

PaintWorklet::PaintWorklet(LocalDOMWindow& window)
    :{}

PaintWorklet::~PaintWorklet() = default;

void PaintWorklet::AddPendingGenerator(const String& name,
                                       CSSPaintImageGeneratorImpl* generator) {}

void PaintWorklet::ResetIsPaintOffThreadForTesting() {}

// We start with a random global scope when a new frame starts. Then within this
// frame, we switch to the other global scope after certain amount of paint
// calls (rand(kMaxPaintCountToSwitch)).
// This approach ensures non-deterministic of global scope selecting, and that
// there is a max of one switching within one frame.
wtf_size_t PaintWorklet::SelectGlobalScope() {}

int PaintWorklet::GetPaintsBeforeSwitching() {}

wtf_size_t PaintWorklet::SelectNewGlobalScope() {}

scoped_refptr<Image> PaintWorklet::Paint(const String& name,
                                         const ImageResourceObserver& observer,
                                         const gfx::SizeF& container_size,
                                         const CSSStyleValueVector* data) {}

// static
const char PaintWorklet::kSupplementName[] =;

void PaintWorklet::Trace(Visitor* visitor) const {}

void PaintWorklet::RegisterCSSPaintDefinition(const String& name,
                                              CSSPaintDefinition* definition,
                                              ExceptionState& exception_state) {}

void PaintWorklet::RegisterMainThreadDocumentPaintDefinition(
    const String& name,
    Vector<CSSPropertyID> native_properties,
    Vector<String> custom_properties,
    Vector<CSSSyntaxDefinition> input_argument_types,
    double alpha) {}

bool PaintWorklet::NeedsToCreateGlobalScope() {}

WorkletGlobalScopeProxy* PaintWorklet::CreateGlobalScope() {}

}  // namespace blink