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

Side by Side Diff: gm/imagefromyuvtextures.cpp

Issue 1793303002: Reland of "more shader-->sp conversions (patchset #5 id:80001 of https://codereview.chromium… (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: make pictureRef a value, so its clearer what's going on Created 4 years, 9 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/imagefilterstransformed.cpp ('k') | gm/imagetoyuvplanes.cpp » ('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 2015 Google Inc. 3 * Copyright 2015 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 22 matching lines...) Expand all
33 SkISize onISize() override { 33 SkISize onISize() override {
34 return SkISize::Make(50, 135); 34 return SkISize::Make(50, 135);
35 } 35 }
36 36
37 void onOnceBeforeDraw() override { 37 void onOnceBeforeDraw() override {
38 // We create an RGB bitmap and then extract YUV bmps where the U and V b itmaps are 38 // We create an RGB bitmap and then extract YUV bmps where the U and V b itmaps are
39 // subsampled by 2 in both dimensions. 39 // subsampled by 2 in both dimensions.
40 SkPaint paint; 40 SkPaint paint;
41 static const SkColor kColors[] = 41 static const SkColor kColors[] =
42 { SK_ColorBLUE, SK_ColorYELLOW, SK_ColorGREEN, SK_ColorWHITE }; 42 { SK_ColorBLUE, SK_ColorYELLOW, SK_ColorGREEN, SK_ColorWHITE };
43 paint.setShader(SkGradientShader::CreateRadial(SkPoint::Make(0,0), kBmpS ize / 2.f, kColors, 43 paint.setShader(SkGradientShader::MakeRadial(SkPoint::Make(0,0), kBmpSiz e / 2.f, kColors,
44 nullptr, SK_ARRAY_COUNT(k Colors), 44 nullptr, SK_ARRAY_COUNT(kCo lors),
45 SkShader::kMirror_TileMod e))->unref(); 45 SkShader::kMirror_TileMode) );
46 SkBitmap rgbBmp; 46 SkBitmap rgbBmp;
47 rgbBmp.allocN32Pixels(kBmpSize, kBmpSize, true); 47 rgbBmp.allocN32Pixels(kBmpSize, kBmpSize, true);
48 SkCanvas canvas(rgbBmp); 48 SkCanvas canvas(rgbBmp);
49 canvas.drawPaint(paint); 49 canvas.drawPaint(paint);
50 SkPMColor* rgbColors = static_cast<SkPMColor*>(rgbBmp.getPixels()); 50 SkPMColor* rgbColors = static_cast<SkPMColor*>(rgbBmp.getPixels());
51 51
52 SkImageInfo yinfo = SkImageInfo::MakeA8(kBmpSize, kBmpSize); 52 SkImageInfo yinfo = SkImageInfo::MakeA8(kBmpSize, kBmpSize);
53 fYUVBmps[0].allocPixels(yinfo); 53 fYUVBmps[0].allocPixels(yinfo);
54 SkImageInfo uinfo = SkImageInfo::MakeA8(kBmpSize / 2, kBmpSize / 2); 54 SkImageInfo uinfo = SkImageInfo::MakeA8(kBmpSize / 2, kBmpSize / 2);
55 fYUVBmps[1].allocPixels(uinfo); 55 fYUVBmps[1].allocPixels(uinfo);
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 166
167 static const int kBmpSize = 32; 167 static const int kBmpSize = 32;
168 168
169 typedef GM INHERITED; 169 typedef GM INHERITED;
170 }; 170 };
171 171
172 DEF_GM(return new ImageFromYUVTextures;) 172 DEF_GM(return new ImageFromYUVTextures;)
173 } 173 }
174 174
175 #endif 175 #endif
OLDNEW
« no previous file with comments | « gm/imagefilterstransformed.cpp ('k') | gm/imagetoyuvplanes.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698