#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "components/viz/service/display/display_resource_provider_skia.h"
#include <stddef.h>
#include <stdint.h>
#include <memory>
#include <optional>
#include <set>
#include <unordered_map>
#include <utility>
#include <vector>
#include "base/check.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_refptr.h"
#include "build/build_config.h"
#include "components/viz/client/client_resource_provider.h"
#include "components/viz/common/resources/release_callback.h"
#include "components/viz/common/resources/returned_resource.h"
#include "components/viz/common/resources/transferable_resource.h"
#include "components/viz/test/test_context_provider.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/khronos/GLES2/gl2.h"
#include "third_party/khronos/GLES2/gl2ext.h"
#include "third_party/skia/include/core/SkColorSpace.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/gpu_fence_handle.h"
_;
ByMove;
DoAll;
Return;
SaveArg;
namespace viz {
namespace {
class MockReleaseCallback { … };
MATCHER_P(SamePtr, ptr_to_expected, "") { … }
static void CollectResources(std::vector<ReturnedResource>* array,
std::vector<ReturnedResource> returned) { … }
class MockExternalUseClient : public ExternalUseClient { … };
class DisplayResourceProviderSkiaTest : public testing::Test { … };
TEST_F(DisplayResourceProviderSkiaTest, LockForExternalUse) { … }
TEST_F(DisplayResourceProviderSkiaTest, LockForExternalUseWebView) { … }
class TestGpuCommandsCompletedFence : public ResourceFence { … };
class TestReleaseFence : public ResourceFence { … };
TEST_F(DisplayResourceProviderSkiaTest,
ResourceFenceStopsReturnToChildOrDelete) { … }
TEST_F(DisplayResourceProviderSkiaTest, ResourceFenceDestroyChild) { … }
TEST_F(DisplayResourceProviderSkiaTest, ResourceFenceOutlivesResourceProvider) { … }
TEST_F(DisplayResourceProviderSkiaTest,
ScopedBatchReturnResourcesPreventsReturn) { … }
}
}