| 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 SkAutoTMalloc<GrColor> dstBuffer(kWidth*kHeight); | 59 SkAutoTMalloc<GrColor> dstBuffer(kWidth*kHeight); |
| 60 | 60 |
| 61 fill_pixel_data(kWidth, kHeight, srcBuffer.get()); | 61 fill_pixel_data(kWidth, kHeight, srcBuffer.get()); |
| 62 | 62 |
| 63 const GrVkCaps* caps = reinterpret_cast<const GrVkCaps*>(context->caps()); | 63 const GrVkCaps* caps = reinterpret_cast<const GrVkCaps*>(context->caps()); |
| 64 | 64 |
| 65 bool canCreate = true; | 65 bool canCreate = true; |
| 66 // the expectation is that the given config is texturable/renderable with op
timal tiling | 66 // the expectation is that the given config is texturable/renderable with op
timal tiling |
| 67 // but may not be with linear tiling | 67 // but may not be with linear tiling |
| 68 if (linearTiling) { | 68 if (linearTiling) { |
| 69 if (!caps->isConfigTexurableLinearly(config) || | 69 if (!caps->isConfigTexturableLinearly(config) || |
| 70 (renderTarget && !caps->isConfigRenderableLinearly(config, false)))
{ | 70 (renderTarget && !caps->isConfigRenderableLinearly(config, false)))
{ |
| 71 canCreate = false; | 71 canCreate = false; |
| 72 } | 72 } |
| 73 } | 73 } |
| 74 | 74 |
| 75 GrSurfaceDesc surfDesc; | 75 GrSurfaceDesc surfDesc; |
| 76 surfDesc.fFlags = renderTarget ? kRenderTarget_GrSurfaceFlag : kNone_GrSurfa
ceFlags; | 76 surfDesc.fFlags = renderTarget ? kRenderTarget_GrSurfaceFlag : kNone_GrSurfa
ceFlags; |
| 77 if (linearTiling) { | 77 if (linearTiling) { |
| 78 surfDesc.fFlags |= kZeroCopy_GrSurfaceFlag; | 78 surfDesc.fFlags |= kZeroCopy_GrSurfaceFlag; |
| 79 } | 79 } |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 basic_texture_test(reporter, ctxInfo.grContext(), kRGBA_8888_GrPixelConfig,
true, false); | 137 basic_texture_test(reporter, ctxInfo.grContext(), kRGBA_8888_GrPixelConfig,
true, false); |
| 138 basic_texture_test(reporter, ctxInfo.grContext(), kRGBA_8888_GrPixelConfig,
false, true); | 138 basic_texture_test(reporter, ctxInfo.grContext(), kRGBA_8888_GrPixelConfig,
false, true); |
| 139 basic_texture_test(reporter, ctxInfo.grContext(), kRGBA_8888_GrPixelConfig,
true, true); | 139 basic_texture_test(reporter, ctxInfo.grContext(), kRGBA_8888_GrPixelConfig,
true, true); |
| 140 basic_texture_test(reporter, ctxInfo.grContext(), kBGRA_8888_GrPixelConfig,
false, false); | 140 basic_texture_test(reporter, ctxInfo.grContext(), kBGRA_8888_GrPixelConfig,
false, false); |
| 141 basic_texture_test(reporter, ctxInfo.grContext(), kBGRA_8888_GrPixelConfig,
true, false); | 141 basic_texture_test(reporter, ctxInfo.grContext(), kBGRA_8888_GrPixelConfig,
true, false); |
| 142 basic_texture_test(reporter, ctxInfo.grContext(), kBGRA_8888_GrPixelConfig,
false, true); | 142 basic_texture_test(reporter, ctxInfo.grContext(), kBGRA_8888_GrPixelConfig,
false, true); |
| 143 basic_texture_test(reporter, ctxInfo.grContext(), kBGRA_8888_GrPixelConfig,
true, true); | 143 basic_texture_test(reporter, ctxInfo.grContext(), kBGRA_8888_GrPixelConfig,
true, true); |
| 144 } | 144 } |
| 145 | 145 |
| 146 #endif | 146 #endif |
| OLD | NEW |