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 "GrVkSampler.h" | 8 #include "GrVkSampler.h" |
9 | 9 |
10 #include "GrTextureAccess.h" | 10 #include "GrTextureAccess.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 } | 67 } |
68 | 68 |
69 void GrVkSampler::freeGPUData(const GrVkGpu* gpu) const { | 69 void GrVkSampler::freeGPUData(const GrVkGpu* gpu) const { |
70 SkASSERT(fSampler); | 70 SkASSERT(fSampler); |
71 GR_VK_CALL(gpu->vkInterface(), DestroySampler(gpu->device(), fSampler, nullp
tr)); | 71 GR_VK_CALL(gpu->vkInterface(), DestroySampler(gpu->device(), fSampler, nullp
tr)); |
72 } | 72 } |
73 | 73 |
74 uint8_t GrVkSampler::GenerateKey(const GrTextureParams& params) { | 74 uint8_t GrVkSampler::GenerateKey(const GrTextureParams& params) { |
75 | 75 |
76 uint8_t key = params.filterMode(); | 76 uint8_t key = params.filterMode(); |
77 | 77 |
78 SkASSERT(params.filterMode() <= 3); | 78 SkASSERT(params.filterMode() <= 3); |
79 key |= (params.getTileModeX() << 2); | 79 key |= (params.getTileModeX() << 2); |
80 | 80 |
81 GR_STATIC_ASSERT(SkShader::kTileModeCount <= 4); | 81 GR_STATIC_ASSERT(SkShader::kTileModeCount <= 4); |
82 key |= (params.getTileModeY() << 4); | 82 key |= (params.getTileModeY() << 4); |
83 | 83 |
84 return key; | 84 return key; |
85 } | 85 } |
86 | |
OLD | NEW |