Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(102)

Side by Side Diff: src/gpu/effects/GrPorterDuffXferProcessor.h

Issue 751283002: Add XferProcessor factory in GrPaint and GrDrawState. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Update gyp Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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
11 #include "GrTypes.h"
12 #include "GrXferProcessor.h"
13 #include "SkXfermode.h"
14
15 class GrBackendFragmentProcessorFactory;
16 class GrDrawState;
17 class GrGLPorterDuffXferProcessor;
18 class GrInvariantOutput;
19
20 class GrPorterDuffXferProcessor : public GrXferProcessor {
21 public:
22 static GrXferProcessor* Create(GrBlendCoeff srcBlend, GrBlendCoeff dstBlend) {
23 return SkNEW_ARGS(GrPorterDuffXferProcessor, (srcBlend, dstBlend));
24 }
25
26 virtual ~GrPorterDuffXferProcessor();
27
28 virtual const GrBackendFragmentProcessorFactory& getFactory() const SK_OVERR IDE;
29
30 typedef GrGLPorterDuffXferProcessor GLProcessor;
31 static const char* Name() { return "Porter Duff"; }
32
33 virtual bool isValidColorStage() const SK_OVERRIDE { return false; }
bsalomon 2014/11/26 21:02:45 no need for virtual keyword w/ override. where is
egdaniel 2014/12/01 18:18:25 Old code that somehow didn't get deleted in clean
34
35 private:
36 GrPorterDuffXferProcessor(GrBlendCoeff srcBlend, GrBlendCoeff dstBlend);
37
38 virtual bool onIsEqual(const GrFragmentProcessor&) const SK_OVERRIDE { retur n true; }
39
40 virtual void onComputeInvariantOutput(GrInvariantOutput* inout) const SK_OVE RRIDE;
41
42 typedef GrXferProcessor INHERITED;
43 };
44
45 ///////////////////////////////////////////////////////////////////////////////
46
47 class GrPorterDuffXPFactory : public GrXPFactory {
48 public:
49 static GrXPFactory* Create(SkXfermode::Coeff src, SkXfermode::Coeff dst) {
50 return SkNEW_ARGS(GrPorterDuffXPFactory, (src, dst));
51 }
52
53 virtual const GrXferProcessor* createXferProcessor() const SK_OVERRIDE;
54
55 virtual bool supportsLCDText(const GrDrawState&) const SK_OVERRIDE;
56
57 protected:
58 GrPorterDuffXPFactory(SkXfermode::Coeff src, SkXfermode::Coeff dst)
59 : INHERITED((GrBlendCoeff)(src), (GrBlendCoeff)(dst)) {}
60
61 private:
62 typedef GrXPFactory INHERITED;
63 };
64
65 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698