#include "third_party/blink/renderer/platform/graphics/canvas_2d_layer_bridge.h"
#include <list>
#include <memory>
#include <utility>
#include "base/run_loop.h"
#include "base/test/scoped_feature_list.h"
#include "cc/base/features.h"
#include "cc/layers/texture_layer.h"
#include "cc/paint/paint_flags.h"
#include "cc/test/skia_common.h"
#include "cc/test/stub_decode_cache.h"
#include "components/viz/test/test_context_provider.h"
#include "components/viz/test/test_gles2_interface.h"
#include "gpu/command_buffer/common/capabilities.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/renderer/platform/graphics/canvas_resource_host.h"
#include "third_party/blink/renderer/platform/graphics/canvas_resource_provider.h"
#include "third_party/blink/renderer/platform/graphics/static_bitmap_image.h"
#include "third_party/blink/renderer/platform/graphics/test/fake_canvas_resource_host.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/scheduler/public/main_thread_scheduler.h"
#include "third_party/blink/renderer/platform/scheduler/public/thread_scheduler.h"
#include "third_party/blink/renderer/platform/testing/runtime_enabled_features_test_helpers.h"
#include "third_party/blink/renderer/platform/testing/task_environment.h"
#include "third_party/skia/include/core/SkImage.h"
#include "third_party/skia/include/gpu/GrDirectContext.h"
namespace blink {
namespace {
_;
AnyNumber;
AtLeast;
InSequence;
Pointee;
Return;
SetArgPointee;
Test;
class AcceleratedCompositingTestPlatform
: public blink::TestingPlatformSupport { … };
}
class Canvas2DLayerBridgeTest : public Test { … };
TEST_F(Canvas2DLayerBridgeTest, DisableAcceleration) { … }
TEST_F(Canvas2DLayerBridgeTest, NoDrawOnContextLost) { … }
TEST_F(Canvas2DLayerBridgeTest, PrepareMailboxWhenContextIsLost) { … }
TEST_F(Canvas2DLayerBridgeTest,
PrepareMailboxWhenContextIsLostWithFailedRestore) { … }
TEST_F(Canvas2DLayerBridgeTest, PrepareMailboxAndLoseResource) { … }
TEST_F(Canvas2DLayerBridgeTest, ReleaseCallbackWithNullContextProviderWrapper) { … }
TEST_F(Canvas2DLayerBridgeTest, RasterModeHint) { … }
TEST_F(Canvas2DLayerBridgeTest, FallbackToSoftwareIfContextLost) { … }
void DrawSomething(Canvas2DLayerBridge* bridge) { … }
TEST_F(Canvas2DLayerBridgeTest, FallbackToSoftwareOnFailedTextureAlloc) { … }
class MockLogger : public Canvas2DLayerBridge::Logger { … };
TEST_F(Canvas2DLayerBridgeTest, HibernationLifeCycle) { … }
TEST_F(Canvas2DLayerBridgeTest, HibernationReEntry) { … }
TEST_F(Canvas2DLayerBridgeTest, TeardownWhileHibernating) { … }
TEST_F(Canvas2DLayerBridgeTest, SnapshotWhileHibernating) { … }
TEST_F(Canvas2DLayerBridgeTest, TeardownWhileHibernationIsPending) { … }
TEST_F(Canvas2DLayerBridgeTest, HibernationAbortedDueToVisibilityChange) { … }
TEST_F(Canvas2DLayerBridgeTest, HibernationAbortedDueToLostContext) { … }
TEST_F(Canvas2DLayerBridgeTest, PrepareMailboxWhileHibernating) { … }
TEST_F(Canvas2DLayerBridgeTest, ResourceRecycling) { … }
TEST_F(Canvas2DLayerBridgeTest, NoResourceRecyclingWhenPageHidden) { … }
TEST_F(Canvas2DLayerBridgeTest,
PrepareTransferableResourceTracksCanvasChanges) { … }
class CustomFakeCanvasResourceHost : public FakeCanvasResourceHost { … };
TEST_F(Canvas2DLayerBridgeTest, WritePixelsRestoresClipStack) { … }
TEST_F(Canvas2DLayerBridgeTest, DisplayedCanvasIsRateLimited) { … }
TEST_F(Canvas2DLayerBridgeTest, NonDisplayedCanvasIsNotRateLimited) { … }
TEST_F(Canvas2DLayerBridgeTest, SoftwareCanvasIsCompositedIfImageChromium) { … }
TEST_F(Canvas2DLayerBridgeTest, SoftwareCanvasNotCompositedIfNotImageChromium) { … }
TEST_F(Canvas2DLayerBridgeTest, PushPropertiesAfterVisibilityChange) { … }
}