#include "third_party/blink/renderer/platform/graphics/offscreen_canvas_placeholder.h"
#include "base/task/single_thread_task_runner.h"
#include "third_party/blink/renderer/platform/graphics/canvas_resource.h"
#include "third_party/blink/renderer/platform/graphics/canvas_resource_dispatcher.h"
#include "third_party/blink/renderer/platform/graphics/resource_id_traits.h"
#include "third_party/blink/renderer/platform/scheduler/public/post_cross_thread_task.h"
#include "third_party/blink/renderer/platform/wtf/cross_thread_copier_base.h"
#include "third_party/blink/renderer/platform/wtf/cross_thread_functional.h"
#include "third_party/blink/renderer/platform/wtf/hash_map.h"
#include "third_party/blink/renderer/platform/wtf/wtf.h"
namespace {
PlaceholderIdMap;
PlaceholderIdMap& placeholderRegistry() { … }
void ReleaseFrameToDispatcher(
base::WeakPtr<blink::CanvasResourceDispatcher> dispatcher,
scoped_refptr<blink::CanvasResource> oldImage,
viz::ResourceId resourceId) { … }
void SetSuspendAnimation(
base::WeakPtr<blink::CanvasResourceDispatcher> dispatcher,
bool suspend) { … }
void UpdateDispatcherFilterQuality(
base::WeakPtr<blink::CanvasResourceDispatcher> dispatcher,
cc::PaintFlags::FilterQuality filter) { … }
}
namespace blink {
OffscreenCanvasPlaceholder::~OffscreenCanvasPlaceholder() { … }
namespace {
void FrameLastUnrefCallback(
base::WeakPtr<CanvasResourceDispatcher> frame_dispatcher,
scoped_refptr<base::SingleThreadTaskRunner> frame_dispatcher_task_runner,
viz::ResourceId placeholder_frame_resource_id,
scoped_refptr<CanvasResource> placeholder_frame) { … }
}
void OffscreenCanvasPlaceholder::SetOffscreenCanvasResource(
scoped_refptr<CanvasResource>&& new_frame,
viz::ResourceId resource_id) { … }
void OffscreenCanvasPlaceholder::SetOffscreenCanvasDispatcher(
base::WeakPtr<CanvasResourceDispatcher> dispatcher,
scoped_refptr<base::SingleThreadTaskRunner> task_runner) { … }
void OffscreenCanvasPlaceholder::UpdateOffscreenCanvasFilterQuality(
cc::PaintFlags::FilterQuality filter_quality) { … }
void OffscreenCanvasPlaceholder::SetSuspendOffscreenCanvasAnimation(
bool suspend) { … }
OffscreenCanvasPlaceholder*
OffscreenCanvasPlaceholder::GetPlaceholderCanvasById(unsigned placeholder_id) { … }
void OffscreenCanvasPlaceholder::RegisterPlaceholderCanvas(
unsigned placeholder_id) { … }
void OffscreenCanvasPlaceholder::UnregisterPlaceholderCanvas() { … }
bool OffscreenCanvasPlaceholder::PostSetSuspendAnimationToOffscreenCanvasThread(
bool suspend) { … }
}