OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 "GrTextureStripAtlas.h" | 8 #include "GrTextureStripAtlas.h" |
9 #include "GrContext.h" | 9 #include "GrContext.h" |
10 #include "GrTexture.h" | 10 #include "GrTexture.h" |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 // Front is least-recently-used | 187 // Front is least-recently-used |
188 AtlasRow* row = fLRUFront; | 188 AtlasRow* row = fLRUFront; |
189 return row; | 189 return row; |
190 } | 190 } |
191 | 191 |
192 void GrTextureStripAtlas::lockTexture() { | 192 void GrTextureStripAtlas::lockTexture() { |
193 GrSurfaceDesc texDesc; | 193 GrSurfaceDesc texDesc; |
194 texDesc.fWidth = fDesc.fWidth; | 194 texDesc.fWidth = fDesc.fWidth; |
195 texDesc.fHeight = fDesc.fHeight; | 195 texDesc.fHeight = fDesc.fHeight; |
196 texDesc.fConfig = fDesc.fConfig; | 196 texDesc.fConfig = fDesc.fConfig; |
| 197 texDesc.fIsMipMapped = false; |
197 | 198 |
198 static const GrUniqueKey::Domain kDomain = GrUniqueKey::GenerateDomain(); | 199 static const GrUniqueKey::Domain kDomain = GrUniqueKey::GenerateDomain(); |
199 GrUniqueKey key; | 200 GrUniqueKey key; |
200 GrUniqueKey::Builder builder(&key, kDomain, 1); | 201 GrUniqueKey::Builder builder(&key, kDomain, 1); |
201 builder[0] = static_cast<uint32_t>(fCacheKey); | 202 builder[0] = static_cast<uint32_t>(fCacheKey); |
202 builder.finish(); | 203 builder.finish(); |
203 | 204 |
204 fTexture = fDesc.fContext->textureProvider()->findAndRefTextureByUniqueKey(k
ey); | 205 fTexture = fDesc.fContext->textureProvider()->findAndRefTextureByUniqueKey(k
ey); |
205 if (nullptr == fTexture) { | 206 if (nullptr == fTexture) { |
206 fTexture = fDesc.fContext->textureProvider()->createTexture(texDesc, SkB
udgeted::kYes, | 207 fTexture = fDesc.fContext->textureProvider()->createTexture(texDesc, SkB
udgeted::kYes, |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 | 343 |
343 // If we have locked rows, we should have a locked texture, otherwise | 344 // If we have locked rows, we should have a locked texture, otherwise |
344 // it should be unlocked | 345 // it should be unlocked |
345 if (fLockedRows == 0) { | 346 if (fLockedRows == 0) { |
346 SkASSERT(nullptr == fTexture); | 347 SkASSERT(nullptr == fTexture); |
347 } else { | 348 } else { |
348 SkASSERT(fTexture); | 349 SkASSERT(fTexture); |
349 } | 350 } |
350 } | 351 } |
351 #endif | 352 #endif |
OLD | NEW |