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

Side by Side Diff: gm/yuvtorgbeffect.cpp

Issue 582963002: Solo gp (Closed) Base URL: https://skia.googlesource.com/skia.git@no_peb
Patch Set: fix Created 6 years, 3 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
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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 SkRect renderRect = SkRect::MakeWH(SkIntToScalar(fBmp[0].width()), 100 SkRect renderRect = SkRect::MakeWH(SkIntToScalar(fBmp[0].width()),
101 SkIntToScalar(fBmp[0].height())); 101 SkIntToScalar(fBmp[0].height()));
102 renderRect.outset(kDrawPad, kDrawPad); 102 renderRect.outset(kDrawPad, kDrawPad);
103 103
104 SkScalar y = kDrawPad + kTestPad + space * kColorSpaceOffset; 104 SkScalar y = kDrawPad + kTestPad + space * kColorSpaceOffset;
105 SkScalar x = kDrawPad + kTestPad; 105 SkScalar x = kDrawPad + kTestPad;
106 106
107 const int indices[6][3] = {{0, 1, 2}, {0, 2, 1}, {1, 0, 2}, {1, 2, 0}, {2, 0, 1}, {2, 1, 0}}; 107 const int indices[6][3] = {{0, 1, 2}, {0, 2, 1}, {1, 0, 2}, {1, 2, 0}, {2, 0, 1}, {2, 1, 0}};
108 108
109 for (int i = 0; i < 6; ++i) { 109 for (int i = 0; i < 6; ++i) {
110 SkAutoTUnref<GrEffect> effect( 110 SkAutoTUnref<GrFragmentProcessor> fp(
111 GrYUVtoRGBEffect::Create(texture[indices[i][0]], 111 GrYUVtoRGBEffect::Create(texture[indices[i][0]],
112 texture[indices[i][1]], 112 texture[indices[i][1]],
113 texture[indices[i][2]], 113 texture[indices[i][2]],
114 static_cast<SkYUVColorSpace>( space))); 114 static_cast<SkYUVColorSpace>( space)));
115 if (effect) { 115 if (fp) {
116 SkMatrix viewMatrix; 116 SkMatrix viewMatrix;
117 viewMatrix.setTranslate(x, y); 117 viewMatrix.setTranslate(x, y);
118 drawState->reset(viewMatrix); 118 drawState->reset(viewMatrix);
119 drawState->setRenderTarget(rt); 119 drawState->setRenderTarget(rt);
120 drawState->setColor(0xffffffff); 120 drawState->setColor(0xffffffff);
121 drawState->addColorEffect(effect); 121 drawState->addColorProcessor(fp);
122 tt.target()->drawSimpleRect(renderRect); 122 tt.target()->drawSimpleRect(renderRect);
123 } 123 }
124 x += renderRect.width() + kTestPad; 124 x += renderRect.width() + kTestPad;
125 } 125 }
126 } 126 }
127 127
128 GrUnlockAndUnrefCachedBitmapTexture(texture[0]); 128 GrUnlockAndUnrefCachedBitmapTexture(texture[0]);
129 GrUnlockAndUnrefCachedBitmapTexture(texture[1]); 129 GrUnlockAndUnrefCachedBitmapTexture(texture[1]);
130 GrUnlockAndUnrefCachedBitmapTexture(texture[2]); 130 GrUnlockAndUnrefCachedBitmapTexture(texture[2]);
131 } 131 }
132 132
133 private: 133 private:
134 SkBitmap fBmp[3]; 134 SkBitmap fBmp[3];
135 135
136 typedef GM INHERITED; 136 typedef GM INHERITED;
137 }; 137 };
138 138
139 DEF_GM( return SkNEW(YUVtoRGBEffect); ) 139 DEF_GM( return SkNEW(YUVtoRGBEffect); )
140 } 140 }
141 141
142 #endif 142 #endif
OLDNEW
« no previous file with comments | « gm/texturedomaineffect.cpp ('k') | gyp/gpu.gypi » ('j') | include/gpu/GrGeometryProcessor.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698