Flutter Engine
The Flutter Engine
GrPorterDuffXferProcessor.h
Go to the documentation of this file.
1/*
2 * Copyright 2014 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
8#ifndef GrPorterDuffXferProcessor_DEFINED
9#define GrPorterDuffXferProcessor_DEFINED
10
16
17enum class GrClampType;
18enum class SkBlendMode;
19
20// See the comment above GrXPFactory's definition about this warning suppression.
21#if defined(__GNUC__)
22#pragma GCC diagnostic push
23#pragma GCC diagnostic ignored "-Wnon-virtual-dtor"
24#endif
25#if defined(__clang__)
26#pragma clang diagnostic push
27#pragma clang diagnostic ignored "-Wnon-virtual-dtor"
28#endif
30public:
31 static const GrXPFactory* Get(SkBlendMode blendMode);
32
33 /** Because src-over is so common we special case it for performance reasons. If this returns
34 null then the SimpleSrcOverXP() below should be used. */
37 const GrCaps&);
38
39 /** Returns a simple non-LCD porter duff blend XP with no optimizations or coverage. */
41
42 /** This XP implements non-LCD src-over using hw blend with no optimizations. It is returned
43 by reference because it is global and its ref-cnting methods are not thread safe. */
44 static const GrXferProcessor& SimpleSrcOverXP();
45
48 const GrCaps&,
50
51private:
53
56 const GrCaps&,
57 GrClampType) const override;
58
59 AnalysisProperties analysisProperties(const GrProcessorAnalysisColor&,
61 const GrCaps&,
62 GrClampType) const override;
63
65 static void TestGetXPOutputTypes(const GrXferProcessor*, int* outPrimary, int* outSecondary);
66
67 SkBlendMode fBlendMode;
68
69 friend class GrPorterDuffTest; // for TestGetXPOutputTypes()
70 using INHERITED = GrXPFactory;
71};
72#if defined(__GNUC__)
73#pragma GCC diagnostic pop
74#endif
75#if defined(__clang__)
76#pragma clang diagnostic pop
77#endif
78
79#endif
GrProcessorAnalysisCoverage
#define GR_DECLARE_XP_FACTORY_TEST
GrClampType
Definition: GrTypesPriv.h:228
SkBlendMode
Definition: SkBlendMode.h:38
Definition: GrCaps.h:57
static sk_sp< const GrXferProcessor > MakeSrcOverXferProcessor(const GrProcessorAnalysisColor &, GrProcessorAnalysisCoverage, const GrCaps &)
static const GrXPFactory * Get(SkBlendMode blendMode)
static sk_sp< const GrXferProcessor > MakeNoCoverageXP(SkBlendMode)
static const GrXferProcessor & SimpleSrcOverXP()
static AnalysisProperties SrcOverAnalysisProperties(const GrProcessorAnalysisColor &, const GrProcessorAnalysisCoverage &, const GrCaps &, GrClampType)
constexpr GrXPFactory()