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

Side by Side Diff: gm/texturedomaineffect.cpp

Issue 2215323003: Start using RenderTargetProxy (omnibus) (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update Created 4 years, 1 month 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/SkMaskFilter.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 * 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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 SkScalar y = kDrawPad + kTestPad; 110 SkScalar y = kDrawPad + kTestPad;
111 for (int tm = 0; tm < textureMatrices.count(); ++tm) { 111 for (int tm = 0; tm < textureMatrices.count(); ++tm) {
112 for (size_t d = 0; d < SK_ARRAY_COUNT(texelDomains); ++d) { 112 for (size_t d = 0; d < SK_ARRAY_COUNT(texelDomains); ++d) {
113 SkScalar x = kDrawPad + kTestPad; 113 SkScalar x = kDrawPad + kTestPad;
114 for (int m = 0; m < GrTextureDomain::kModeCount; ++m) { 114 for (int m = 0; m < GrTextureDomain::kModeCount; ++m) {
115 GrTextureDomain::Mode mode = (GrTextureDomain::Mode) m; 115 GrTextureDomain::Mode mode = (GrTextureDomain::Mode) m;
116 GrPaint grPaint; 116 GrPaint grPaint;
117 grPaint.setXPFactory(GrPorterDuffXPFactory::Make(SkBlendMode ::kSrc)); 117 grPaint.setXPFactory(GrPorterDuffXPFactory::Make(SkBlendMode ::kSrc));
118 sk_sp<GrFragmentProcessor> fp( 118 sk_sp<GrFragmentProcessor> fp(
119 GrTextureDomainEffect::Make(texture.get(), nullptr, text ureMatrices[tm], 119 GrTextureDomainEffect::Make(texture.get(), nullptr, text ureMatrices[tm],
120 GrTextureDomain::MakeTexelDomain (texture.get(), 120 GrTextureDomain::MakeTexelDomain (texture->width(),
121 texture->height(),
121 texelDomains[d]), 122 texelDomains[d]),
122 mode, GrTextureParams::kNone_Fil terMode)); 123 mode, GrTextureParams::kNone_Fil terMode));
123 124
124 if (!fp) { 125 if (!fp) {
125 continue; 126 continue;
126 } 127 }
127 const SkMatrix viewMatrix = SkMatrix::MakeTrans(x, y); 128 const SkMatrix viewMatrix = SkMatrix::MakeTrans(x, y);
128 grPaint.addColorFragmentProcessor(std::move(fp)); 129 grPaint.addColorFragmentProcessor(std::move(fp));
129 130
130 sk_sp<GrDrawBatch> batch( 131 sk_sp<GrDrawBatch> batch(
(...skipping 14 matching lines...) Expand all
145 static constexpr int kTargetHeight = 100; 146 static constexpr int kTargetHeight = 100;
146 SkBitmap fBmp; 147 SkBitmap fBmp;
147 148
148 typedef GM INHERITED; 149 typedef GM INHERITED;
149 }; 150 };
150 151
151 DEF_GM(return new TextureDomainEffect;) 152 DEF_GM(return new TextureDomainEffect;)
152 } 153 }
153 154
154 #endif 155 #endif
OLDNEW
« no previous file with comments | « no previous file | include/core/SkMaskFilter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698