#include "cc/test/layer_tree_pixel_test.h"
#include <stddef.h>
#include <stdint.h>
#include "base/command_line.h"
#include "base/functional/bind.h"
#include "base/path_service.h"
#include "base/test/test_switches.h"
#include "cc/layers/solid_color_layer.h"
#include "cc/layers/texture_layer.h"
#include "cc/test/pixel_comparator.h"
#include "cc/test/pixel_test_output_surface.h"
#include "cc/test/pixel_test_utils.h"
#include "cc/test/test_layer_tree_frame_sink.h"
#include "cc/test/test_types.h"
#include "cc/trees/effect_node.h"
#include "cc/trees/layer_tree_impl.h"
#include "components/viz/common/display/renderer_settings.h"
#include "components/viz/common/frame_sinks/copy_output_request.h"
#include "components/viz/common/frame_sinks/copy_output_result.h"
#include "components/viz/common/gpu/raster_context_provider.h"
#include "components/viz/service/display/software_output_device.h"
#include "components/viz/service/display_embedder/skia_output_surface_dependency_impl.h"
#include "components/viz/service/display_embedder/skia_output_surface_impl.h"
#include "components/viz/test/paths.h"
#include "components/viz/test/test_gpu_service_holder.h"
#include "components/viz/test/test_in_process_context_provider.h"
#include "skia/buildflags.h"
#if BUILDFLAG(SKIA_USE_DAWN)
#include "third_party/dawn/include/dawn/dawn_proc.h"
#include "third_party/dawn/include/dawn/native/DawnNative.h"
#endif
GLES2Interface;
namespace cc {
namespace {
TestRasterType GetDefaultRasterType(viz::RendererType renderer_type) { … }
}
LayerTreePixelTest::LayerTreePixelTest(viz::RendererType renderer_type)
: … { … }
LayerTreePixelTest::~LayerTreePixelTest() = default;
std::unique_ptr<TestLayerTreeFrameSink>
LayerTreePixelTest::CreateLayerTreeFrameSink(
const viz::RendererSettings& renderer_settings,
double refresh_rate,
scoped_refptr<viz::RasterContextProvider>,
scoped_refptr<viz::RasterContextProvider>) { … }
void LayerTreePixelTest::DrawLayersOnThread(LayerTreeHostImpl* host_impl) { … }
void LayerTreePixelTest::InitializeSettings(LayerTreeSettings* settings) { … }
std::unique_ptr<viz::DisplayCompositorMemoryAndTaskController>
LayerTreePixelTest::CreateDisplayControllerOnThread() { … }
std::unique_ptr<viz::SkiaOutputSurface>
LayerTreePixelTest::CreateSkiaOutputSurfaceOnThread(
viz::DisplayCompositorMemoryAndTaskController* display_controller) { … }
std::unique_ptr<viz::OutputSurface>
LayerTreePixelTest::CreateSoftwareOutputSurfaceOnThread() { … }
std::unique_ptr<viz::CopyOutputRequest>
LayerTreePixelTest::CreateCopyOutputRequest() { … }
void LayerTreePixelTest::ReadbackResult(
std::unique_ptr<viz::CopyOutputResult> result) { … }
void LayerTreePixelTest::BeginTest() { … }
void LayerTreePixelTest::AfterTest() { … }
scoped_refptr<SolidColorLayer> LayerTreePixelTest::CreateSolidColorLayer(
const gfx::Rect& rect, SkColor color) { … }
void LayerTreePixelTest::EndTest() { … }
void LayerTreePixelTest::TryEndTest() { … }
scoped_refptr<SolidColorLayer> LayerTreePixelTest::
CreateSolidColorLayerWithBorder(
const gfx::Rect& rect, SkColor color,
int border_width, SkColor border_color) { … }
void LayerTreePixelTest::CreateSolidColorLayerPlusBorders(
const gfx::Rect& rect,
SkColor color,
int border_width,
SkColor border_color,
std::vector<scoped_refptr<SolidColorLayer>>& layers) { … }
void LayerTreePixelTest::RunPixelTest(scoped_refptr<Layer> content_root,
base::FilePath file_name) { … }
void LayerTreePixelTest::RunPixelTest(scoped_refptr<Layer> content_root,
const SkBitmap& expected_bitmap) { … }
void LayerTreePixelTest::RunPixelTestWithLayerList(base::FilePath file_name) { … }
void LayerTreePixelTest::RunSingleThreadedPixelTest(
scoped_refptr<Layer> content_root,
base::FilePath file_name) { … }
void LayerTreePixelTest::RunPixelTestWithReadbackTarget(
scoped_refptr<Layer> content_root,
Layer* target,
base::FilePath file_name) { … }
void LayerTreePixelTest::SetupTree() { … }
}