| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 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 "SkLinearBitmapPipeline.h" | 8 #include "SkLinearBitmapPipeline.h" |
| 9 #include "SkColor.h" | 9 #include "SkColor.h" |
| 10 #include "SkPM4f.h" | 10 #include "SkPM4f.h" |
| 11 #include "Test.h" | 11 #include "Test.h" |
| 12 | 12 |
| 13 struct SinkBilerpProcessor final : public PointProcessorInterface { | |
| 14 void pointListFew(int n, Sk4fArg xs, Sk4fArg ys) override { fXs = xs; fYs =
ys; } | |
| 15 void pointList4(Sk4fArg Xs, Sk4fArg Ys) override { fXs = Xs; fYs = Ys; } | |
| 16 void pointSpan(SkPoint start, SkScalar length, int count) override { } | |
| 17 Sk4f fXs; | |
| 18 Sk4f fYs; | |
| 19 }; | |
| 20 | |
| 21 using Pixel = float[4]; | 13 using Pixel = float[4]; |
| 22 DEF_TEST(SkBitmapFP, reporter) { | 14 DEF_TEST(SkBitmapFP, reporter) { |
| 23 | 15 |
| 24 int width = 10; | 16 int width = 10; |
| 25 int height = 10; | 17 int height = 10; |
| 26 uint32_t* bitmap = new uint32_t[width * height]; | 18 uint32_t* bitmap = new uint32_t[width * height]; |
| 27 for (int y = 0; y < height; y++) { | 19 for (int y = 0; y < height; y++) { |
| 28 for (int x = 0; x < width; x++) { | 20 for (int x = 0; x < width; x++) { |
| 29 bitmap[y * width + x] = (y << 8) + x + (128<<24); | 21 bitmap[y * width + x] = (y << 8) + x + (128<<24); |
| 30 } | 22 } |
| (...skipping 26 matching lines...) Expand all Loading... |
| 57 pixelBuffer[i][1] * 255.0f, | 49 pixelBuffer[i][1] * 255.0f, |
| 58 pixelBuffer[i][2] * 255.0f, | 50 pixelBuffer[i][2] * 255.0f, |
| 59 pixelBuffer[i][3] * 255.0f); | 51 pixelBuffer[i][3] * 255.0f); |
| 60 } | 52 } |
| 61 #endif | 53 #endif |
| 62 | 54 |
| 63 delete [] bitmap; | 55 delete [] bitmap; |
| 64 delete [] FPbuffer; | 56 delete [] FPbuffer; |
| 65 } | 57 } |
| 66 | 58 |
| OLD | NEW |