#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include <stdint.h>
#include "build/build_config.h"
#include "cc/layers/solid_color_layer.h"
#include "cc/paint/paint_image.h"
#include "cc/paint/paint_image_builder.h"
#include "cc/paint/render_surface_filters.h"
#include "cc/paint/skia_paint_canvas.h"
#include "cc/test/fake_content_layer_client.h"
#include "cc/test/fake_picture_layer.h"
#include "cc/test/layer_tree_pixel_resource_test.h"
#include "cc/test/pixel_comparator.h"
#include "cc/test/test_layer_tree_frame_sink.h"
#include "components/viz/test/buildflags.h"
#include "third_party/skia/include/core/SkImage.h"
#include "third_party/skia/include/core/SkSurface.h"
#if !BUILDFLAG(IS_ANDROID)
namespace cc {
namespace {
SkBlendMode const kBlendModes[] = …;
SkColor kCSSTestColors[] = …;
const int kCSSTestColorsCount = …;
RenderPassOptions;
const uint32_t kUseMasks = …;
const uint32_t kUseAntialiasing = …;
const uint32_t kUseColorMatrix = …;
class LayerTreeHostBlendingPixelTest
: public LayerTreeHostPixelResourceTest,
public ::testing::WithParamInterface<
::testing::tuple<RasterTestConfig, SkBlendMode>> { … };
std::vector<RasterTestConfig> const kTestCases = {
{viz::RendererType::kSoftware, TestRasterType::kBitmap},
#if BUILDFLAG(ENABLE_GL_BACKEND_TESTS)
{viz::RendererType::kSkiaGL, TestRasterType::kGpu},
#endif
#if BUILDFLAG(ENABLE_VULKAN_BACKEND_TESTS)
{viz::RendererType::kSkiaVk, TestRasterType::kGpu},
#endif
#if BUILDFLAG(ENABLE_SKIA_GRAPHITE_TESTS)
{viz::RendererType::kSkiaGraphiteDawn, TestRasterType::kGpu},
#if BUILDFLAG(IS_IOS)
{viz::RendererType::kSkiaGraphiteMetal, TestRasterType::kGpu},
#endif
#endif
};
INSTANTIATE_TEST_SUITE_P(
B,
LayerTreeHostBlendingPixelTest,
::testing::Combine(::testing::ValuesIn(kTestCases),
::testing::ValuesIn(kBlendModes)),
[](const testing::TestParamInfo<
testing::tuple<RasterTestConfig, SkBlendMode>>& info) -> std::string { … };
TEST_P(LayerTreeHostBlendingPixelTest, BlendingWithRoot) { … }
TEST_P(LayerTreeHostBlendingPixelTest, BlendingWithBackdropFilter) { … }
TEST_P(LayerTreeHostBlendingPixelTest, BlendingWithTransparent) { … }
TEST_P(LayerTreeHostBlendingPixelTest, BlendingWithRenderPass) { … }
TEST_P(LayerTreeHostBlendingPixelTest, BlendingWithRenderPassAA) { … }
TEST_P(LayerTreeHostBlendingPixelTest, BlendingWithRenderPassColorMatrix) { … }
TEST_P(LayerTreeHostBlendingPixelTest, BlendingWithRenderPassWithMask) { … }
TEST_P(LayerTreeHostBlendingPixelTest, BlendingWithRenderPassColorMatrixAA) { … }
TEST_P(LayerTreeHostBlendingPixelTest, BlendingWithRenderPassWithMaskAA) { … }
TEST_P(LayerTreeHostBlendingPixelTest,
BlendingWithRenderPassWithMaskColorMatrix) { … }
TEST_P(LayerTreeHostBlendingPixelTest,
BlendingWithRenderPassWithMaskColorMatrixAA) { … }
}
}
#endif