#include "cc/layers/texture_layer.h"
#include <stddef.h>
#include <stdint.h>
#include <algorithm>
#include <memory>
#include <string>
#include <utility>
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/location.h"
#include "base/memory/ptr_util.h"
#include "base/memory/raw_ptr.h"
#include "base/run_loop.h"
#include "base/synchronization/lock.h"
#include "base/synchronization/waitable_event.h"
#include "base/task/sequenced_task_runner.h"
#include "base/task/single_thread_task_runner.h"
#include "base/threading/thread.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "cc/animation/animation_host.h"
#include "cc/layers/solid_color_layer.h"
#include "cc/layers/texture_layer_client.h"
#include "cc/layers/texture_layer_impl.h"
#include "cc/test/fake_impl_task_runner_provider.h"
#include "cc/test/fake_layer_tree_frame_sink.h"
#include "cc/test/fake_layer_tree_host_client.h"
#include "cc/test/fake_layer_tree_host_impl.h"
#include "cc/test/layer_test_common.h"
#include "cc/test/layer_tree_test.h"
#include "cc/test/stub_layer_tree_host_single_thread_client.h"
#include "cc/test/test_layer_tree_frame_sink.h"
#include "cc/test/test_task_graph_runner.h"
#include "cc/trees/layer_tree_host.h"
#include "cc/trees/layer_tree_impl.h"
#include "cc/trees/single_thread_proxy.h"
#include "components/viz/common/gpu/raster_context_provider.h"
#include "components/viz/common/quads/texture_draw_quad.h"
#include "components/viz/common/resources/bitmap_allocation.h"
#include "components/viz/common/resources/returned_resource.h"
#include "components/viz/common/resources/shared_bitmap.h"
#include "components/viz/common/resources/transferable_resource.h"
#include "components/viz/common/surfaces/parent_local_surface_id_allocator.h"
#include "components/viz/service/display/software_output_device.h"
#include "components/viz/test/fake_output_surface.h"
#include "gpu/GLES2/gl2extchromium.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
_;
AnyNumber;
AtLeast;
InvokeWithoutArgs;
Mock;
#define EXPECT_SET_NEEDS_COMMIT(expect, code_to_test) …
namespace cc {
namespace {
gpu::Mailbox MailboxFromChar(char value) { … }
gpu::SyncToken SyncTokenFromUInt(uint32_t value) { … }
scoped_refptr<CrossThreadSharedBitmap> AllocateCrossThreadSharedBitmap(
gfx::Size size,
viz::SharedImageFormat format) { … }
class MockLayerTreeHost : public LayerTreeHost { … };
class MockReleaseCallback { … };
struct CommonResourceObjects { … };
class TextureLayerTest : public testing::Test { … };
TEST_F(TextureLayerTest, CheckPropertyChangeCausesCorrectBehavior) { … }
class RunOnCommitLayerTreeHostClient : public FakeLayerTreeHostClient { … };
TEST_F(TextureLayerTest, ShutdownWithResource) { … }
class TestMailboxHolder : public TextureLayer::TransferableResourceHolder { … };
class TextureLayerWithResourceTest : public TextureLayerTest { … };
TEST_F(TextureLayerWithResourceTest, ReplaceMailboxOnMainThreadBeforeCommit) { … }
TEST_F(TextureLayerWithResourceTest, AffectedByHdr) { … }
class TextureLayerMailboxHolderTest : public TextureLayerTest { … };
TEST_F(TextureLayerMailboxHolderTest, TwoCompositors_BothReleaseThenMain) { … }
TEST_F(TextureLayerMailboxHolderTest, TwoCompositors_MainReleaseBetween) { … }
TEST_F(TextureLayerMailboxHolderTest, TwoCompositors_MainReleasedFirst) { … }
class TextureLayerImplWithMailboxThreadedCallback : public LayerTreeTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(TextureLayerImplWithMailboxThreadedCallback);
class TextureLayerImplWithResourceTest : public TextureLayerTest { … };
TEST_F(TextureLayerImplWithResourceTest, TestWillDraw) { … }
TEST_F(TextureLayerImplWithResourceTest, TestImplLayerCallbacks) { … }
TEST_F(TextureLayerImplWithResourceTest,
TestDestructorCallbackOnCreatedResource) { … }
class TextureLayerNoExtraCommitForMailboxTest : public LayerTreeTest,
public TextureLayerClient { … };
SINGLE_AND_MULTI_THREAD_TEST_F(TextureLayerNoExtraCommitForMailboxTest);
class TextureLayerChangeInvisibleMailboxTest : public LayerTreeTest,
public TextureLayerClient { … };
#if BUILDFLAG(IS_CHROMEOS)
#define MAYBE_SINGLE_AND_MULTI_THREAD_TEST_F …
#else
#define MAYBE_SINGLE_AND_MULTI_THREAD_TEST_F …
#endif
MAYBE_SINGLE_AND_MULTI_THREAD_TEST_F(TextureLayerChangeInvisibleMailboxTest);
class TextureLayerReleaseResourcesBase : public LayerTreeTest,
public TextureLayerClient { … };
class TextureLayerReleaseResourcesAfterCommit
: public TextureLayerReleaseResourcesBase { … };
SINGLE_AND_MULTI_THREAD_TEST_F(TextureLayerReleaseResourcesAfterCommit);
class TextureLayerReleaseResourcesAfterActivate
: public TextureLayerReleaseResourcesBase { … };
SINGLE_AND_MULTI_THREAD_TEST_F(TextureLayerReleaseResourcesAfterActivate);
class TextureLayerWithResourceMainThreadDeleted : public LayerTreeTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(TextureLayerWithResourceMainThreadDeleted);
class TextureLayerWithResourceImplThreadDeleted : public LayerTreeTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(TextureLayerWithResourceImplThreadDeleted);
class StubTextureLayerClient : public TextureLayerClient { … };
class SoftwareLayerTreeHostClient : public StubLayerTreeHostClient { … };
class SoftwareTextureLayerTest : public LayerTreeTest { … };
class SoftwareTextureLayerSwitchTreesTest : public SoftwareTextureLayerTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(SoftwareTextureLayerSwitchTreesTest);
class SoftwareTextureLayerPurgeMemoryTest : public SoftwareTextureLayerTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(SoftwareTextureLayerPurgeMemoryTest);
class SoftwareTextureLayerMultipleRegisterTest
: public SoftwareTextureLayerTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(SoftwareTextureLayerMultipleRegisterTest);
class SoftwareTextureLayerRegisterUnregisterTest
: public SoftwareTextureLayerTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(SoftwareTextureLayerRegisterUnregisterTest);
class SoftwareTextureLayerLoseFrameSinkTest : public SoftwareTextureLayerTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(SoftwareTextureLayerLoseFrameSinkTest);
class SoftwareTextureLayerUnregisterRegisterTest
: public SoftwareTextureLayerTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(SoftwareTextureLayerUnregisterRegisterTest);
class TextureLayerNoResourceTest : public LayerTreeTest, TextureLayerClient { … };
SINGLE_AND_MULTI_THREAD_TEST_F(TextureLayerNoResourceTest);
}
}