#include "third_party/blink/renderer/platform/graphics/canvas_resource_provider.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/task_environment.h"
#include "build/build_config.h"
#include "cc/test/paint_image_matchers.h"
#include "cc/test/skia_common.h"
#include "components/viz/common/resources/release_callback.h"
#include "components/viz/test/test_context_provider.h"
#include "components/viz/test/test_gles2_interface.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/platform/scheduler/test/renderer_scheduler_test_support.h"
#include "third_party/blink/renderer/platform/graphics/canvas_resource_dispatcher.h"
#include "third_party/blink/renderer/platform/graphics/gpu/shared_gpu_context.h"
#include "third_party/blink/renderer/platform/graphics/static_bitmap_image.h"
#include "third_party/blink/renderer/platform/graphics/test/fake_gles2_interface.h"
#include "third_party/blink/renderer/platform/graphics/test/fake_web_graphics_context_3d_provider.h"
#include "third_party/blink/renderer/platform/graphics/test/gpu_memory_buffer_test_platform.h"
#include "third_party/blink/renderer/platform/graphics/test/gpu_test_utils.h"
#include "third_party/blink/renderer/platform/graphics/test/test_webgraphics_shared_image_interface_provider.h"
#include "third_party/blink/renderer/platform/testing/task_environment.h"
#include "third_party/blink/renderer/platform/wtf/functional.h"
#include "ui/gfx/buffer_types.h"
_;
InSequence;
Return;
Test;
namespace blink {
namespace {
constexpr int kMaxTextureSize = …;
class MockCanvasResourceDispatcherClient
: public CanvasResourceDispatcherClient { … };
class ImageTrackingDecodeCache : public cc::StubDecodeCache { … };
class CanvasResourceProviderTest : public Test { … };
TEST_F(CanvasResourceProviderTest, CanvasResourceProviderAcceleratedOverlay) { … }
TEST_F(CanvasResourceProviderTest, CanvasResourceProviderTexture) { … }
TEST_F(CanvasResourceProviderTest, CanvasResourceProviderUnacceleratedOverlay) { … }
std::unique_ptr<CanvasResourceProvider> MakeCanvasResourceProvider(
RasterMode raster_mode,
base::WeakPtr<WebGraphicsContext3DProviderWrapper>
context_provider_wrapper) { … }
scoped_refptr<CanvasResource> UpdateResource(CanvasResourceProvider* provider) { … }
void EnsureResourceRecycled(CanvasResourceProvider* provider,
scoped_refptr<CanvasResource>&& resource) { … }
TEST_F(CanvasResourceProviderTest,
CanvasResourceProviderSharedImageResourceRecycling) { … }
TEST_F(CanvasResourceProviderTest, CanvasResourceProviderUnusedResources) { … }
TEST_F(CanvasResourceProviderTest,
CanvasResourceProviderDontReclaimUnusedResourcesWhenFeatureIsDisabled) { … }
TEST_F(CanvasResourceProviderTest,
CanvasResourceProviderUnusedResourcesAreNotCollectedWhenYoung) { … }
TEST_F(CanvasResourceProviderTest,
CanvasResourceProviderSharedImageStaticBitmapImage) { … }
TEST_F(CanvasResourceProviderTest, NoRecycleIfLastRefCallback) { … }
TEST_F(CanvasResourceProviderTest,
CanvasResourceProviderSharedImageCopyOnWriteDisabled) { … }
TEST_F(CanvasResourceProviderTest, CanvasResourceProviderBitmap) { … }
TEST_F(CanvasResourceProviderTest, CanvasResourceProviderSharedBitmap) { … }
TEST_F(CanvasResourceProviderTest,
CanvasResourceProviderDirect2DGpuMemoryBuffer) { … }
TEST_F(CanvasResourceProviderTest,
CanvasResourceProviderDirect3DGpuMemoryBuffer) { … }
TEST_F(CanvasResourceProviderTest, DimensionsExceedMaxTextureSize_Bitmap) { … }
TEST_F(CanvasResourceProviderTest, DimensionsExceedMaxTextureSize_SharedImage) { … }
TEST_F(CanvasResourceProviderTest, DimensionsExceedMaxTextureSize_SwapChain) { … }
TEST_F(CanvasResourceProviderTest, DimensionsExceedMaxTextureSize_PassThrough) { … }
TEST_F(CanvasResourceProviderTest, CanvasResourceProviderDirect2DSwapChain) { … }
TEST_F(CanvasResourceProviderTest, FlushForImage) { … }
TEST_F(CanvasResourceProviderTest, EnsureCCImageCacheUse) { … }
TEST_F(CanvasResourceProviderTest, ImagesLockedUntilCacheLimit) { … }
TEST_F(CanvasResourceProviderTest, QueuesCleanupTaskForLockedImages) { … }
TEST_F(CanvasResourceProviderTest, ImageCacheOnContextLost) { … }
TEST_F(CanvasResourceProviderTest, FlushCanvasReleasesAllReleasableOps) { … }
TEST_F(CanvasResourceProviderTest, FlushCanvasReleasesAllOpsOutsideLayers) { … }
}
}