#include "third_party/blink/renderer/platform/graphics/gpu/image_layer_bridge.h"
#include "base/memory/read_only_shared_memory_region.h"
#include "cc/layers/texture_layer.h"
#include "cc/resources/cross_thread_shared_bitmap.h"
#include "components/viz/common/resources/bitmap_allocation.h"
#include "components/viz/common/resources/shared_bitmap.h"
#include "components/viz/common/resources/shared_image_format_utils.h"
#include "components/viz/common/resources/transferable_resource.h"
#include "gpu/command_buffer/client/gles2_interface.h"
#include "gpu/command_buffer/client/shared_image_interface.h"
#include "gpu/command_buffer/common/shared_image_usage.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/public/platform/platform.h"
#include "third_party/blink/public/platform/web_graphics_context_3d_provider.h"
#include "third_party/blink/public/platform/web_graphics_shared_image_interface_provider.h"
#include "third_party/blink/renderer/platform/graphics/accelerated_static_bitmap_image.h"
#include "third_party/blink/renderer/platform/graphics/canvas_color_params.h"
#include "third_party/blink/renderer/platform/graphics/canvas_resource_provider.h"
#include "third_party/blink/renderer/platform/graphics/color_behavior.h"
#include "third_party/blink/renderer/platform/graphics/gpu/shared_gpu_context.h"
#include "third_party/blink/renderer/platform/graphics/image_orientation.h"
#include "third_party/blink/renderer/platform/graphics/skia/skia_utils.h"
#include "third_party/blink/renderer/platform/wtf/functional.h"
#include "ui/gfx/geometry/size.h"
namespace blink {
namespace {
scoped_refptr<StaticBitmapImage> MakeAccelerated(
const scoped_refptr<StaticBitmapImage>& source,
base::WeakPtr<WebGraphicsContext3DProviderWrapper>
context_provider_wrapper) { … }
}
ImageLayerBridge::ImageLayerBridge(OpacityMode opacity_mode)
: … { … }
ImageLayerBridge::~ImageLayerBridge() { … }
void ImageLayerBridge::SetImage(scoped_refptr<StaticBitmapImage> image) { … }
void ImageLayerBridge::SetFilterQuality(
cc::PaintFlags::FilterQuality filter_quality) { … }
void ImageLayerBridge::SetUV(const gfx::PointF& left_top,
const gfx::PointF& right_bottom) { … }
void ImageLayerBridge::Dispose() { … }
bool ImageLayerBridge::PrepareTransferableResource(
cc::SharedBitmapIdRegistrar* bitmap_registrar,
viz::TransferableResource* out_resource,
viz::ReleaseCallback* out_release_callback) { … }
ImageLayerBridge::RegisteredBitmap ImageLayerBridge::CreateOrRecycleBitmap(
const gfx::Size& size,
viz::SharedImageFormat format,
cc::SharedBitmapIdRegistrar* bitmap_registrar) { … }
void ImageLayerBridge::ResourceReleasedGpu(
scoped_refptr<StaticBitmapImage> image,
const gpu::SyncToken& token,
bool lost_resource) { … }
void ImageLayerBridge::ResourceReleasedSoftware(
RegisteredBitmap registered,
const gpu::SyncToken& sync_token,
bool lost_resource) { … }
cc::Layer* ImageLayerBridge::CcLayer() const { … }
ImageLayerBridge::RegisteredBitmap::RegisteredBitmap() = default;
ImageLayerBridge::RegisteredBitmap::RegisteredBitmap(RegisteredBitmap&& other) =
default;
ImageLayerBridge::RegisteredBitmap& ImageLayerBridge::RegisteredBitmap::
operator=(RegisteredBitmap&& other) = default;
}