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

Unified Diff: tests/PathOpsExtendedTest.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/PDFPrimitivesTest.cpp ('k') | tests/PathOpsSkpClipTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/PathOpsExtendedTest.cpp
diff --git a/tests/PathOpsExtendedTest.cpp b/tests/PathOpsExtendedTest.cpp
index 1083a897e15657c35bb6b7b3a36c728377712477..cee27e458899ed296c9fb375ccfc53d5bbd8146b 100644
--- a/tests/PathOpsExtendedTest.cpp
+++ b/tests/PathOpsExtendedTest.cpp
@@ -289,8 +289,7 @@ static void scaleMatrix(const SkPath& one, const SkPath& two, SkMatrix& scale) {
static int pathsDrawTheSame(SkBitmap& bits, const SkPath& scaledOne, const SkPath& scaledTwo,
int& error2x2) {
if (bits.width() == 0) {
- bits.setConfig(SkBitmap::kARGB_8888_Config, bitWidth * 2, bitHeight);
- bits.allocPixels();
+ bits.allocN32Pixels(bitWidth * 2, bitHeight);
}
SkCanvas canvas(bits);
canvas.drawColor(SK_ColorWHITE);
@@ -355,8 +354,7 @@ bool drawAsciiPaths(const SkPath& one, const SkPath& two, bool drawPaths) {
if (bitHeight >= (int) sizeof(out)) {
return false;
}
- bits.setConfig(SkBitmap::kARGB_8888_Config, bitWidth * 2, bitHeight);
- bits.allocPixels();
+ bits.allocN32Pixels(bitWidth * 2, bitHeight);
SkCanvas canvas(bits);
canvas.drawColor(SK_ColorWHITE);
SkPaint paint;
« no previous file with comments | « tests/PDFPrimitivesTest.cpp ('k') | tests/PathOpsSkpClipTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698