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

Side by Side Diff: include/client/android/SkPixelXorXfermode.h

Issue 1853103005: remove avoid and pixelxor xfermodes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update factory counts Created 4 years, 8 months 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
« no previous file with comments | « include/client/android/SkAvoidXfermode.h ('k') | src/effects/SkAvoidXfermode.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright 2007 The Android Open Source Project
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 SkPixelXorXfermode_DEFINED
9 #define SkPixelXorXfermode_DEFINED
10
11 #include "SkXfermode.h"
12
13 /** SkPixelXorXfermode implements a simple pixel xor (op ^ src ^ dst).
14 This transformation does not follow premultiplied conventions, therefore
15 this proc *always* returns an opaque color (alpha == 255). Thus it is
16 not really usefull for operating on blended colors.
17 */
18 class SK_API SkPixelXorXfermode : public SkXfermode {
19 public:
20 static sk_sp<SkXfermode> Make(SkColor opColor) {
21 return sk_sp<SkXfermode>(new SkPixelXorXfermode(opColor));
22 }
23 #ifdef SK_SUPPORT_LEGACY_XFERMODE_PTR
24 static SkXfermode* Create(SkColor opColor) {
25 return Make(opColor).release();
26 }
27 #endif
28
29 #if SK_SUPPORT_GPU
30 const GrFragmentProcessor* getFragmentProcessorForImageFilter(
31 const GrFragmentProcessor* d st) const override;
32 GrXPFactory* asXPFactory() const override;
33 #endif
34
35 SK_TO_STRING_OVERRIDE()
36 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkPixelXorXfermode)
37
38 protected:
39 void flatten(SkWriteBuffer&) const override;
40 SkPMColor xferColor(SkPMColor src, SkPMColor dst) const override;
41
42 private:
43 explicit SkPixelXorXfermode(SkColor opColor) {
44 fOpColor = SkPreMultiplyColor(opColor | 0xFF000000);
45 }
46
47 SkPMColor fOpColor;
48
49 typedef SkXfermode INHERITED;
50 };
51
52 #endif
OLDNEW
« no previous file with comments | « include/client/android/SkAvoidXfermode.h ('k') | src/effects/SkAvoidXfermode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698