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" |
(...skipping 34 matching lines...) Loading... |
45 } | 45 } |
46 srcPtr += width; | 46 srcPtr += width; |
47 dstPtr += width; | 47 dstPtr += width; |
48 } | 48 } |
49 return true; | 49 return true; |
50 } | 50 } |
51 | 51 |
52 void basic_texture_test(skiatest::Reporter* reporter, GrContext* context, GrPixe
lConfig config, | 52 void basic_texture_test(skiatest::Reporter* reporter, GrContext* context, GrPixe
lConfig config, |
53 bool renderTarget, bool linearTiling) { | 53 bool renderTarget, bool linearTiling) { |
54 GrVkGpu* gpu = static_cast<GrVkGpu*>(context->getGpu()); | 54 GrVkGpu* gpu = static_cast<GrVkGpu*>(context->getGpu()); |
55 gpu->discard(NULL); | |
56 | 55 |
57 const int kWidth = 16; | 56 const int kWidth = 16; |
58 const int kHeight = 16; | 57 const int kHeight = 16; |
59 SkAutoTMalloc<GrColor> srcBuffer(kWidth*kHeight); | 58 SkAutoTMalloc<GrColor> srcBuffer(kWidth*kHeight); |
60 SkAutoTMalloc<GrColor> dstBuffer(kWidth*kHeight); | 59 SkAutoTMalloc<GrColor> dstBuffer(kWidth*kHeight); |
61 | 60 |
62 fill_pixel_data(kWidth, kHeight, srcBuffer.get()); | 61 fill_pixel_data(kWidth, kHeight, srcBuffer.get()); |
63 | 62 |
64 const GrVkCaps* caps = reinterpret_cast<const GrVkCaps*>(context->caps()); | 63 const GrVkCaps* caps = reinterpret_cast<const GrVkCaps*>(context->caps()); |
65 | 64 |
(...skipping 72 matching lines...) Loading... |
138 basic_texture_test(reporter, ctxInfo.grContext(), kRGBA_8888_GrPixelConfig,
true, false); | 137 basic_texture_test(reporter, ctxInfo.grContext(), kRGBA_8888_GrPixelConfig,
true, false); |
139 basic_texture_test(reporter, ctxInfo.grContext(), kRGBA_8888_GrPixelConfig,
false, true); | 138 basic_texture_test(reporter, ctxInfo.grContext(), kRGBA_8888_GrPixelConfig,
false, true); |
140 basic_texture_test(reporter, ctxInfo.grContext(), kRGBA_8888_GrPixelConfig,
true, true); | 139 basic_texture_test(reporter, ctxInfo.grContext(), kRGBA_8888_GrPixelConfig,
true, true); |
141 basic_texture_test(reporter, ctxInfo.grContext(), kBGRA_8888_GrPixelConfig,
false, false); | 140 basic_texture_test(reporter, ctxInfo.grContext(), kBGRA_8888_GrPixelConfig,
false, false); |
142 basic_texture_test(reporter, ctxInfo.grContext(), kBGRA_8888_GrPixelConfig,
true, false); | 141 basic_texture_test(reporter, ctxInfo.grContext(), kBGRA_8888_GrPixelConfig,
true, false); |
143 basic_texture_test(reporter, ctxInfo.grContext(), kBGRA_8888_GrPixelConfig,
false, true); | 142 basic_texture_test(reporter, ctxInfo.grContext(), kBGRA_8888_GrPixelConfig,
false, true); |
144 basic_texture_test(reporter, ctxInfo.grContext(), kBGRA_8888_GrPixelConfig,
true, true); | 143 basic_texture_test(reporter, ctxInfo.grContext(), kBGRA_8888_GrPixelConfig,
true, true); |
145 } | 144 } |
146 | 145 |
147 #endif | 146 #endif |
OLD | NEW |