| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 // This is a GPU-backend specific test. It relies on static intializers to work | 8 // This is a GPU-backend specific test. It relies on static intializers to work |
| 9 | 9 |
| 10 #include "SkTypes.h" | 10 #include "SkTypes.h" |
| 11 | 11 |
| 12 #if SK_SUPPORT_GPU && SK_ALLOW_STATIC_GLOBAL_INITIALIZERS && defined(SK_VULKAN) | 12 #if SK_SUPPORT_GPU && SK_ALLOW_STATIC_GLOBAL_INITIALIZERS && defined(SK_VULKAN) |
| 13 | 13 |
| 14 #include "GrContextFactory.h" | 14 #include "GrContextFactory.h" |
| 15 #include "GrTest.h" | 15 #include "GrTest.h" |
| 16 #include "Test.h" | 16 #include "Test.h" |
| 17 #include "vk/GrVkGpu.h" | 17 #include "vk/GrVkGpu.h" |
| 18 | 18 |
| 19 using sk_gpu_test::GrContextFactory; |
| 19 | 20 |
| 20 void fill_pixel_data(int width, int height, GrColor* data) { | 21 void fill_pixel_data(int width, int height, GrColor* data) { |
| 21 | 22 |
| 22 // build red-green gradient | 23 // build red-green gradient |
| 23 for (int j = 0; j < height; ++j) { | 24 for (int j = 0; j < height; ++j) { |
| 24 for (int i = 0; i < width; ++i) { | 25 for (int i = 0; i < width; ++i) { |
| 25 unsigned int red = (unsigned int)(256.f*(i / (float)width)); | 26 unsigned int red = (unsigned int)(256.f*(i / (float)width)); |
| 26 unsigned int green = (unsigned int)(256.f*(j / (float)height)); | 27 unsigned int green = (unsigned int)(256.f*(j / (float)height)); |
| 27 data[i + j*width] = GrColorPackRGBA(red - (red>>8), green - (green>>
8), 0xff, 0xff); | 28 data[i + j*width] = GrColorPackRGBA(red - (red>>8), green - (green>>
8), 0xff, 0xff); |
| 28 } | 29 } |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 basic_texture_test(reporter, context, kBGRA_8888_GrPixelConfig, fals
e, false); | 151 basic_texture_test(reporter, context, kBGRA_8888_GrPixelConfig, fals
e, false); |
| 151 basic_texture_test(reporter, context, kBGRA_8888_GrPixelConfig, true
, false); | 152 basic_texture_test(reporter, context, kBGRA_8888_GrPixelConfig, true
, false); |
| 152 basic_texture_test(reporter, context, kBGRA_8888_GrPixelConfig, fals
e, true); | 153 basic_texture_test(reporter, context, kBGRA_8888_GrPixelConfig, fals
e, true); |
| 153 basic_texture_test(reporter, context, kBGRA_8888_GrPixelConfig, true
, true); | 154 basic_texture_test(reporter, context, kBGRA_8888_GrPixelConfig, true
, true); |
| 154 } | 155 } |
| 155 | 156 |
| 156 } | 157 } |
| 157 } | 158 } |
| 158 | 159 |
| 159 #endif | 160 #endif |
| OLD | NEW |