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

Side by Side Diff: tests/SurfaceTest.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/SkpSkGrTest.cpp ('k') | tests/TileGridTest.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 2013 Google Inc. 2 * Copyright 2013 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 "SkCanvas.h" 8 #include "SkCanvas.h"
9 #include "SkData.h" 9 #include "SkData.h"
10 #include "SkImageEncoder.h" 10 #include "SkImageEncoder.h"
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 const SkColor testColor = 0x01020304; 171 const SkColor testColor = 0x01020304;
172 const SkPaint testPaint; 172 const SkPaint testPaint;
173 const SkPoint testPoints[3] = { 173 const SkPoint testPoints[3] = {
174 {SkIntToScalar(0), SkIntToScalar(0)}, 174 {SkIntToScalar(0), SkIntToScalar(0)},
175 {SkIntToScalar(2), SkIntToScalar(1)}, 175 {SkIntToScalar(2), SkIntToScalar(1)},
176 {SkIntToScalar(0), SkIntToScalar(2)} 176 {SkIntToScalar(0), SkIntToScalar(2)}
177 }; 177 };
178 const size_t testPointCount = 3; 178 const size_t testPointCount = 3;
179 179
180 SkBitmap testBitmap; 180 SkBitmap testBitmap;
181 testBitmap.setConfig(SkBitmap::kARGB_8888_Config, 10, 10); 181 testBitmap.allocN32Pixels(10, 10);
182 testBitmap.allocPixels();
183 testBitmap.eraseColor(0); 182 testBitmap.eraseColor(0);
184 183
185 SkRRect testRRect; 184 SkRRect testRRect;
186 testRRect.setRectXY(testRect, SK_Scalar1, SK_Scalar1); 185 testRRect.setRectXY(testRect, SK_Scalar1, SK_Scalar1);
187 186
188 SkString testText("Hello World"); 187 SkString testText("Hello World");
189 const SkPoint testPoints2[] = { 188 const SkPoint testPoints2[] = {
190 { SkIntToScalar(0), SkIntToScalar(1) }, 189 { SkIntToScalar(0), SkIntToScalar(1) },
191 { SkIntToScalar(1), SkIntToScalar(1) }, 190 { SkIntToScalar(1), SkIntToScalar(1) },
192 { SkIntToScalar(2), SkIntToScalar(1) }, 191 { SkIntToScalar(2), SkIntToScalar(1) },
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 Test_crbug263329(reporter, context); 345 Test_crbug263329(reporter, context);
347 TestSurfaceCopyOnWrite(reporter, kGpu_SurfaceType, context); 346 TestSurfaceCopyOnWrite(reporter, kGpu_SurfaceType, context);
348 TestSurfaceWritableAfterSnapshotRelease(reporter, kGpu_SurfaceType, context); 347 TestSurfaceWritableAfterSnapshotRelease(reporter, kGpu_SurfaceType, context);
349 TestSurfaceNoCanvas(reporter, kGpu_SurfaceType, context, SkSurface:: kDiscard_ContentChangeMode); 348 TestSurfaceNoCanvas(reporter, kGpu_SurfaceType, context, SkSurface:: kDiscard_ContentChangeMode);
350 TestSurfaceNoCanvas(reporter, kGpu_SurfaceType, context, SkSurface:: kRetain_ContentChangeMode); 349 TestSurfaceNoCanvas(reporter, kGpu_SurfaceType, context, SkSurface:: kRetain_ContentChangeMode);
351 TestGetTexture(reporter, kGpu_SurfaceType, context); 350 TestGetTexture(reporter, kGpu_SurfaceType, context);
352 } 351 }
353 } 352 }
354 #endif 353 #endif
355 } 354 }
OLDNEW
« no previous file with comments | « tests/SkpSkGrTest.cpp ('k') | tests/TileGridTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698