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

Side by Side Diff: gm/texturedomaineffect.cpp

Issue 2154753003: Introduce GrColorSpaceXform, for gamut conversion on textures (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: More progress & refactoring Created 4 years, 5 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 | « gm/texdata.cpp ('k') | gyp/gpu.gypi » ('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 * Copyright 2014 Google Inc. 2 * Copyright 2014 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 // This test only works with the GPU backend. 8 // This test only works with the GPU backend.
9 9
10 #include "gm.h" 10 #include "gm.h"
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 108
109 SkScalar y = kDrawPad + kTestPad; 109 SkScalar y = kDrawPad + kTestPad;
110 for (int tm = 0; tm < textureMatrices.count(); ++tm) { 110 for (int tm = 0; tm < textureMatrices.count(); ++tm) {
111 for (size_t d = 0; d < SK_ARRAY_COUNT(texelDomains); ++d) { 111 for (size_t d = 0; d < SK_ARRAY_COUNT(texelDomains); ++d) {
112 SkScalar x = kDrawPad + kTestPad; 112 SkScalar x = kDrawPad + kTestPad;
113 for (int m = 0; m < GrTextureDomain::kModeCount; ++m) { 113 for (int m = 0; m < GrTextureDomain::kModeCount; ++m) {
114 GrTextureDomain::Mode mode = (GrTextureDomain::Mode) m; 114 GrTextureDomain::Mode mode = (GrTextureDomain::Mode) m;
115 GrPaint grPaint; 115 GrPaint grPaint;
116 grPaint.setXPFactory(GrPorterDuffXPFactory::Make(SkXfermode: :kSrc_Mode)); 116 grPaint.setXPFactory(GrPorterDuffXPFactory::Make(SkXfermode: :kSrc_Mode));
117 sk_sp<GrFragmentProcessor> fp( 117 sk_sp<GrFragmentProcessor> fp(
118 GrTextureDomainEffect::Make(texture, textureMatrices[tm] , 118 GrTextureDomainEffect::Make(texture, nullptr, textureMat rices[tm],
119 GrTextureDomain::MakeTexelDomain (texture, 119 GrTextureDomain::MakeTexelDomain (texture,
120 texelDomains[d]), 120 texelDomains[d]),
121 mode, GrTextureParams::kNone_Fil terMode)); 121 mode, GrTextureParams::kNone_Fil terMode));
122 122
123 if (!fp) { 123 if (!fp) {
124 continue; 124 continue;
125 } 125 }
126 const SkMatrix viewMatrix = SkMatrix::MakeTrans(x, y); 126 const SkMatrix viewMatrix = SkMatrix::MakeTrans(x, y);
127 grPaint.addColorFragmentProcessor(std::move(fp)); 127 grPaint.addColorFragmentProcessor(std::move(fp));
128 128
(...skipping 19 matching lines...) Expand all
148 }; 148 };
149 149
150 // Windows builds did not like SkScalar initialization in class :( 150 // Windows builds did not like SkScalar initialization in class :(
151 const SkScalar TextureDomainEffect::kDrawPad = 10.f; 151 const SkScalar TextureDomainEffect::kDrawPad = 10.f;
152 const SkScalar TextureDomainEffect::kTestPad = 10.f; 152 const SkScalar TextureDomainEffect::kTestPad = 10.f;
153 153
154 DEF_GM(return new TextureDomainEffect;) 154 DEF_GM(return new TextureDomainEffect;)
155 } 155 }
156 156
157 #endif 157 #endif
OLDNEW
« no previous file with comments | « gm/texdata.cpp ('k') | gyp/gpu.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698