Flutter Engine
The Flutter Engine
Functions
AdvancedBlendTest.cpp File Reference
#include "include/core/SkBlendMode.h"
#include "include/gpu/GrDirectContext.h"
#include "include/private/SkColorData.h"
#include "include/private/gpu/ganesh/GrTypesPriv.h"
#include "src/gpu/Blend.h"
#include "src/gpu/ganesh/GrCaps.h"
#include "src/gpu/ganesh/GrDirectContextPriv.h"
#include "src/gpu/ganesh/GrPaint.h"
#include "src/gpu/ganesh/GrProcessorAnalysis.h"
#include "src/gpu/ganesh/GrProcessorSet.h"
#include "src/gpu/ganesh/GrUserStencilSettings.h"
#include "src/gpu/ganesh/GrXferProcessor.h"
#include "src/gpu/ganesh/effects/GrCustomXfermode.h"
#include "tests/CtsEnforcement.h"
#include "tests/Test.h"
#include <utility>

Go to the source code of this file.

Functions

 DEF_GANESH_TEST_FOR_RENDERING_CONTEXTS (AdvancedBlendTest, reporter, ctxInfo, CtsEnforcement::kApiLevel_T)
 

Function Documentation

◆ DEF_GANESH_TEST_FOR_RENDERING_CONTEXTS()

DEF_GANESH_TEST_FOR_RENDERING_CONTEXTS ( AdvancedBlendTest  ,
reporter  ,
ctxInfo  ,
CtsEnforcement::kApiLevel_T   
)

Definition at line 28 of file AdvancedBlendTest.cpp.

31 {
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}
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
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