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

Side by Side Diff: gm/texdata.cpp

Issue 759713002: Make all blending up to GrOptDrawState be handled by the xp/xp factory. (Closed) Base URL: https://skia.googlesource.com/skia.git@xferFactorySolo
Patch Set: rebase 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
« no previous file with comments | « no previous file | include/core/SkXfermode.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 // This test only works with the GPU backend. 9 // This test only works with the GPU backend.
10 10
11 #include "gm.h" 11 #include "gm.h"
12 12
13 #if SK_SUPPORT_GPU 13 #if SK_SUPPORT_GPU
14 #include "GrContext.h" 14 #include "GrContext.h"
15 #include "SkColorPriv.h"
16 #include "effects/GrPorterDuffXferProcessor.h"
15 #include "effects/GrSimpleTextureEffect.h" 17 #include "effects/GrSimpleTextureEffect.h"
16 #include "SkColorPriv.h"
17 18
18 namespace skiagm { 19 namespace skiagm {
19 20
20 static const int S = 200; 21 static const int S = 200;
21 22
22 class TexDataGM : public GM { 23 class TexDataGM : public GM {
23 public: 24 public:
24 TexDataGM() { 25 TexDataGM() {
25 this->setBGColor(0xff000000); 26 this->setBGColor(0xff000000);
26 } 27 }
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 if (!texture) { 92 if (!texture) {
92 return; 93 return;
93 } 94 }
94 SkAutoTUnref<GrTexture> au(texture); 95 SkAutoTUnref<GrTexture> au(texture);
95 96
96 GrContext::AutoClip acs(ctx, SkRect::MakeWH(2*S, 2*S)); 97 GrContext::AutoClip acs(ctx, SkRect::MakeWH(2*S, 2*S));
97 98
98 ctx->setRenderTarget(target); 99 ctx->setRenderTarget(target);
99 100
100 GrPaint paint; 101 GrPaint paint;
101 paint.setBlendFunc(kOne_GrBlendCoeff, kISA_GrBlendCoeff); 102 paint.setPorterDuffXPFactory(SkXfermode::kSrcOver_Mode);
103
102 SkMatrix vm; 104 SkMatrix vm;
103 if (i) { 105 if (i) {
104 vm.setRotate(90 * SK_Scalar1, 106 vm.setRotate(90 * SK_Scalar1,
105 S * SK_Scalar1, 107 S * SK_Scalar1,
106 S * SK_Scalar1); 108 S * SK_Scalar1);
107 } else { 109 } else {
108 vm.reset(); 110 vm.reset();
109 } 111 }
110 ctx->setMatrix(vm); 112 ctx->setMatrix(vm);
111 SkMatrix tm; 113 SkMatrix tm;
(...skipping 25 matching lines...) Expand all
137 }; 139 };
138 140
139 ////////////////////////////////////////////////////////////////////////////// 141 //////////////////////////////////////////////////////////////////////////////
140 142
141 static GM* MyFactory(void*) { return new TexDataGM; } 143 static GM* MyFactory(void*) { return new TexDataGM; }
142 static GMRegistry reg(MyFactory); 144 static GMRegistry reg(MyFactory);
143 145
144 } 146 }
145 147
146 #endif 148 #endif
OLDNEW
« no previous file with comments | « no previous file | include/core/SkXfermode.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698