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

Side by Side Diff: gm/yuvtorgbeffect.cpp

Issue 374923002: Goodbye GrEffectRef. (Closed) Base URL: https://skia.googlesource.com/skia.git@noref3
Patch Set: Address comments Created 6 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/texturedomaineffect.cpp ('k') | include/core/SkColorShader.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 2014 Google Inc. 3 * Copyright 2014 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
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 SkRect renderRect = SkRect::MakeWH(SkIntToScalar(fBmp[0].width()), 97 SkRect renderRect = SkRect::MakeWH(SkIntToScalar(fBmp[0].width()),
98 SkIntToScalar(fBmp[0].height())); 98 SkIntToScalar(fBmp[0].height()));
99 renderRect.outset(kDrawPad, kDrawPad); 99 renderRect.outset(kDrawPad, kDrawPad);
100 100
101 SkScalar y = kDrawPad + kTestPad; 101 SkScalar y = kDrawPad + kTestPad;
102 SkScalar x = kDrawPad + kTestPad; 102 SkScalar x = kDrawPad + kTestPad;
103 103
104 const int indices[6][3] = {{0, 1, 2}, {0, 2, 1}, {1, 0, 2}, {1, 2, 0}, { 2, 0, 1}, {2, 1, 0}}; 104 const int indices[6][3] = {{0, 1, 2}, {0, 2, 1}, {1, 0, 2}, {1, 2, 0}, { 2, 0, 1}, {2, 1, 0}};
105 105
106 for (int i = 0; i < 6; ++i) { 106 for (int i = 0; i < 6; ++i) {
107 SkAutoTUnref<GrEffectRef> effect( 107 SkAutoTUnref<GrEffect> effect(
108 GrYUVtoRGBEffect::Create(texture[indices[i][0]], 108 GrYUVtoRGBEffect::Create(texture[indices[i][0]],
109 texture[indices[i][1]], 109 texture[indices[i][1]],
110 texture[indices[i][2]])); 110 texture[indices[i][2]]));
111 if (effect) { 111 if (effect) {
112 SkMatrix viewMatrix; 112 SkMatrix viewMatrix;
113 viewMatrix.setTranslate(x, y); 113 viewMatrix.setTranslate(x, y);
114 drawState->reset(viewMatrix); 114 drawState->reset(viewMatrix);
115 drawState->setRenderTarget(rt); 115 drawState->setRenderTarget(rt);
116 drawState->setColor(0xffffffff); 116 drawState->setColor(0xffffffff);
117 drawState->addColorEffect(effect, 1); 117 drawState->addColorEffect(effect, 1);
(...skipping 10 matching lines...) Expand all
128 private: 128 private:
129 SkBitmap fBmp[3]; 129 SkBitmap fBmp[3];
130 130
131 typedef GM INHERITED; 131 typedef GM INHERITED;
132 }; 132 };
133 133
134 DEF_GM( return SkNEW(YUVtoRGBEffect); ) 134 DEF_GM( return SkNEW(YUVtoRGBEffect); )
135 } 135 }
136 136
137 #endif 137 #endif
OLDNEW
« no previous file with comments | « gm/texturedomaineffect.cpp ('k') | include/core/SkColorShader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698