chromium/cc/trees/layer_tree_host_pixeltest_blending.cc

// Copyright 2013 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/351564777): Remove this and convert code to safer constructs.
#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  // BUILDFLAG(ENABLE_GL_BACKEND_TESTS)
#if BUILDFLAG(ENABLE_VULKAN_BACKEND_TESTS)
    {viz::RendererType::kSkiaVk, TestRasterType::kGpu},
#endif  // BUILDFLAG(ENABLE_VULKAN_BACKEND_TESTS)
#if BUILDFLAG(ENABLE_SKIA_GRAPHITE_TESTS)
    {viz::RendererType::kSkiaGraphiteDawn, TestRasterType::kGpu},
#if BUILDFLAG(IS_IOS)
    {viz::RendererType::kSkiaGraphiteMetal, TestRasterType::kGpu},
#endif  // BUILDFLAG(IS_IOS)
#endif  // BUILDFLAG(ENABLE_SKIA_GRAPHITE_TESTS)
};

INSTANTIATE_TEST_SUITE_P(
    B,
    LayerTreeHostBlendingPixelTest,
    ::testing::Combine(::testing::ValuesIn(kTestCases),
                       ::testing::ValuesIn(kBlendModes)),
    // Print a parameter label for blending tests. Use this instead of
    // PrintTupleToStringParamName() because the PrintTo(SkBlendMode)
    // implementation wasn't being used on some platforms (crbug.com/1123758).
    [](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) {}

}  // namespace
}  // namespace cc

#endif  // BUILDFLAG(IS_ANDROID)