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

Side by Side Diff: tests/FlatDataTest.cpp

Issue 162643002: replace setConfig+allocPixels with single call (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « tests/EmptyPathTest.cpp ('k') | tests/GradientTest.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 * Copyright 2012 Google Inc. 2 * Copyright 2012 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 #include "SkBitmap.h" 8 #include "SkBitmap.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkColor.h" 10 #include "SkColor.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 colors[0] = SK_ColorRED; 61 colors[0] = SK_ColorRED;
62 colors[1] = SK_ColorBLUE; 62 colors[1] = SK_ColorBLUE;
63 63
64 SkAutoTUnref<SkShader> shader(SkGradientShader::CreateLinear(points, colors, NULL, 2, 64 SkAutoTUnref<SkShader> shader(SkGradientShader::CreateLinear(points, colors, NULL, 2,
65 SkShader::kRepe at_TileMode)); 65 SkShader::kRepe at_TileMode));
66 testCreate<SkFlattenableTraits>(reporter, *shader); 66 testCreate<SkFlattenableTraits>(reporter, *shader);
67 67
68 // Test SkBitmap 68 // Test SkBitmap
69 { 69 {
70 SkBitmap bm; 70 SkBitmap bm;
71 bm.setConfig(SkBitmap::kARGB_8888_Config, 50, 50); 71 bm.allocN32Pixels(50, 50);
72 bm.allocPixels();
73 SkCanvas canvas(bm); 72 SkCanvas canvas(bm);
74 SkPaint paint; 73 SkPaint paint;
75 paint.setShader(shader); 74 paint.setShader(shader);
76 canvas.drawPaint(paint); 75 canvas.drawPaint(paint);
77 testCreate<SkBitmapTraits>(reporter, bm); 76 testCreate<SkBitmapTraits>(reporter, bm);
78 } 77 }
79 78
80 // Test SkColorFilter 79 // Test SkColorFilter
81 SkAutoTUnref<SkColorFilter> cf(SkColorFilter::CreateLightingFilter(SK_ColorB LUE, SK_ColorRED)); 80 SkAutoTUnref<SkColorFilter> cf(SkColorFilter::CreateLightingFilter(SK_ColorB LUE, SK_ColorRED));
82 testCreate<SkFlattenableTraits>(reporter, *cf); 81 testCreate<SkFlattenableTraits>(reporter, *cf);
83 82
84 // Test SkXfermode 83 // Test SkXfermode
85 SkAutoTUnref<SkXfermode> xfer(SkXfermode::Create(SkXfermode::kDstOver_Mode)) ; 84 SkAutoTUnref<SkXfermode> xfer(SkXfermode::Create(SkXfermode::kDstOver_Mode)) ;
86 testCreate<SkFlattenableTraits>(reporter, *xfer); 85 testCreate<SkFlattenableTraits>(reporter, *xfer);
87 } 86 }
OLDNEW
« no previous file with comments | « tests/EmptyPathTest.cpp ('k') | tests/GradientTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698