| OLD | NEW |
| 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 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 // Writes unique pixel values at locations specified by coords. | 235 // Writes unique pixel values at locations specified by coords. |
| 236 static void writeCoordPixels(SkBitmap& bm, const Coordinates& coords) { | 236 static void writeCoordPixels(SkBitmap& bm, const Coordinates& coords) { |
| 237 for (int i = 0; i < coords.length; ++i) | 237 for (int i = 0; i < coords.length; ++i) |
| 238 setPixel(coords[i]->fX, coords[i]->fY, i, bm); | 238 setPixel(coords[i]->fX, coords[i]->fY, i, bm); |
| 239 } | 239 } |
| 240 | 240 |
| 241 static void TestBitmapCopy(skiatest::Reporter* reporter) { | 241 static void TestBitmapCopy(skiatest::Reporter* reporter) { |
| 242 static const Pair gPairs[] = { | 242 static const Pair gPairs[] = { |
| 243 { SkBitmap::kNo_Config, "00000000" }, | 243 { SkBitmap::kNo_Config, "00000000" }, |
| 244 { SkBitmap::kA1_Config, "01000000" }, | 244 { SkBitmap::kA1_Config, "01000000" }, |
| 245 { SkBitmap::kA8_Config, "00101110" }, | 245 { SkBitmap::kA8_Config, "00101010" }, |
| 246 { SkBitmap::kIndex8_Config, "00111110" }, | 246 { SkBitmap::kIndex8_Config, "00111010" }, |
| 247 { SkBitmap::kRGB_565_Config, "00101110" }, | 247 { SkBitmap::kRGB_565_Config, "00101010" }, |
| 248 { SkBitmap::kARGB_4444_Config, "00101110" }, | 248 { SkBitmap::kARGB_4444_Config, "00101110" }, |
| 249 { SkBitmap::kARGB_8888_Config, "00101110" }, | 249 { SkBitmap::kARGB_8888_Config, "00101010" }, |
| 250 // TODO: create valid RLE bitmap to test with | 250 // TODO: create valid RLE bitmap to test with |
| 251 // { SkBitmap::kRLE_Index8_Config, "00101111" } | 251 // { SkBitmap::kRLE_Index8_Config, "00101111" } |
| 252 }; | 252 }; |
| 253 | 253 |
| 254 static const bool isExtracted[] = { | 254 static const bool isExtracted[] = { |
| 255 false, true | 255 false, true |
| 256 }; | 256 }; |
| 257 | 257 |
| 258 const int W = 20; | 258 const int W = 20; |
| 259 const int H = 33; | 259 const int H = 33; |
| (...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 606 | 606 |
| 607 #endif | 607 #endif |
| 608 } | 608 } |
| 609 } | 609 } |
| 610 } // for (size_t copyCase ... | 610 } // for (size_t copyCase ... |
| 611 } | 611 } |
| 612 } | 612 } |
| 613 | 613 |
| 614 #include "TestClassDef.h" | 614 #include "TestClassDef.h" |
| 615 DEFINE_TESTCLASS("BitmapCopy", TestBitmapCopyClass, TestBitmapCopy) | 615 DEFINE_TESTCLASS("BitmapCopy", TestBitmapCopyClass, TestBitmapCopy) |
| OLD | NEW |