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

Side by Side Diff: tests/BitmapCopyTest.cpp

Issue 68973005: Expand pixelref to return SkImageInfo and rowbytes (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 1 month 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
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 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 #include "Test.h" 8 #include "Test.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkRect.h" 10 #include "SkRect.h"
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 219
220 // Writes unique pixel values at locations specified by coords. 220 // Writes unique pixel values at locations specified by coords.
221 static void writeCoordPixels(SkBitmap& bm, const Coordinates& coords) { 221 static void writeCoordPixels(SkBitmap& bm, const Coordinates& coords) {
222 for (int i = 0; i < coords.length; ++i) 222 for (int i = 0; i < coords.length; ++i)
223 setPixel(coords[i]->fX, coords[i]->fY, i, bm); 223 setPixel(coords[i]->fX, coords[i]->fY, i, bm);
224 } 224 }
225 225
226 static void TestBitmapCopy(skiatest::Reporter* reporter) { 226 static void TestBitmapCopy(skiatest::Reporter* reporter) {
227 static const Pair gPairs[] = { 227 static const Pair gPairs[] = {
228 { SkBitmap::kNo_Config, "00000000" }, 228 { SkBitmap::kNo_Config, "00000000" },
229 { SkBitmap::kA1_Config, "01000000" }, 229 { SkBitmap::kA1_Config, "00000000" },
scroggo 2013/11/20 21:04:28 Seems like part of a separate change.
reed1 2013/11/20 21:27:18 Needed since w/ this change, A1 is no longer suppo
230 { SkBitmap::kA8_Config, "00101010" }, 230 { SkBitmap::kA8_Config, "00101010" },
231 { SkBitmap::kIndex8_Config, "00111010" }, 231 { SkBitmap::kIndex8_Config, "00111010" },
232 { SkBitmap::kRGB_565_Config, "00101010" }, 232 { SkBitmap::kRGB_565_Config, "00101010" },
233 { SkBitmap::kARGB_4444_Config, "00101110" }, 233 { SkBitmap::kARGB_4444_Config, "00101110" },
234 { SkBitmap::kARGB_8888_Config, "00101110" }, 234 { SkBitmap::kARGB_8888_Config, "00101110" },
235 }; 235 };
236 236
237 static const bool isExtracted[] = { 237 static const bool isExtracted[] = {
238 false, true 238 false, true
239 }; 239 };
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
590 false); 590 false);
591 591
592 #endif 592 #endif
593 } 593 }
594 } // for (size_t copyCase ... 594 } // for (size_t copyCase ...
595 } 595 }
596 } 596 }
597 597
598 #include "TestClassDef.h" 598 #include "TestClassDef.h"
599 DEFINE_TESTCLASS("BitmapCopy", TestBitmapCopyClass, TestBitmapCopy) 599 DEFINE_TESTCLASS("BitmapCopy", TestBitmapCopyClass, TestBitmapCopy)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698