Flutter Engine
The Flutter Engine
AdvancedBlendTest.cpp
Go to the documentation of this file.
1/*
2 * Copyright 2019 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
12#include "src/gpu/Blend.h"
22#include "tests/Test.h"
23
24#include <utility>
25
26struct GrContextOptions;
27
30 ctxInfo,
32 static constexpr auto opaque = GrProcessorAnalysisColor::Opaque::kYes;
34 const GrCaps& caps = *ctxInfo.directContext()->priv().caps();
35
37 const SkBlendMode blendMode = (SkBlendMode)mode;
38 const skgpu::BlendEquation blendEquation = (skgpu::BlendEquation)(mode +
40 const GrXPFactory* xpf = GrCustomXfermode::Get(blendMode);
41
44
46 paint.setXPFactory(xpf);
47 GrProcessorSet procs(std::move(paint));
48 SkPMColor4f overrideColor;
49 GrProcessorSet::Analysis processorAnalysis = procs.finalize(
50 opaque, coverage, nullptr, &GrUserStencilSettings::kUnused, caps,
51 GrClampType::kAuto, &overrideColor);
52
54 !caps.isAdvancedBlendEquationDisabled(blendEquation)) {
59 } else {
62 == caps.blendEquationSupport());
64 }
65 } else {
70 } else {
72 }
73 }
74 }
75}
DEF_GANESH_TEST_FOR_RENDERING_CONTEXTS(AdvancedBlendTest, reporter, ctxInfo, CtsEnforcement::kApiLevel_T)
reporter
Definition: FontMgrTest.cpp:39
SkBlendMode
Definition: SkBlendMode.h:38
@ kLastCoeffMode
last porter duff blend mode
@ kOverlay
multiply or screen, depending on destination
@ kLastMode
last valid value
#define REPORTER_ASSERT(r, cond,...)
Definition: Test.h:286
Definition: GrCaps.h:57
bool advancedBlendEquationSupport() const
Definition: GrCaps.h:162
@ kAdvancedCoherent_BlendEquationSupport
Definition: GrCaps.h:154
@ kAdvanced_BlendEquationSupport
Definition: GrCaps.h:152
bool isAdvancedBlendEquationDisabled(skgpu::BlendEquation equation) const
Definition: GrCaps.h:170
BlendEquationSupport blendEquationSupport() const
Definition: GrCaps.h:160
bool requiresNonOverlappingDraws() const
Analysis finalize(const GrProcessorAnalysisColor &, const GrProcessorAnalysisCoverage, const GrAppliedClip *, const GrUserStencilSettings *, const GrCaps &, GrClampType, SkPMColor4f *inputColorOverride)
static AnalysisProperties GetAnalysisProperties(const GrXPFactory *, const GrProcessorAnalysisColor &, const GrProcessorAnalysisCoverage &, const GrCaps &, GrClampType)
const Paint & paint
Definition: color_source.cc:38
const GrXPFactory * Get(SkBlendMode mode)
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive mode
Definition: switches.h:228
BlendEquation
Definition: Blend.h:26
static const GrUserStencilSettings & kUnused