Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: src/gpu/GrContext.cpp

Issue 303273008: Revert of Initial work to get ETC1 data up to the GPU (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « include/gpu/GrTypes.h ('k') | src/gpu/GrGpu.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #include "GrContext.h" 10 #include "GrContext.h"
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 GrTexture* GrContext::createTexture(const GrTextureParams* params, 381 GrTexture* GrContext::createTexture(const GrTextureParams* params,
382 const GrTextureDesc& desc, 382 const GrTextureDesc& desc,
383 const GrCacheID& cacheID, 383 const GrCacheID& cacheID,
384 const void* srcData, 384 const void* srcData,
385 size_t rowBytes, 385 size_t rowBytes,
386 GrResourceKey* cacheKey) { 386 GrResourceKey* cacheKey) {
387 GrResourceKey resourceKey = GrTextureImpl::ComputeKey(fGpu, params, desc, ca cheID); 387 GrResourceKey resourceKey = GrTextureImpl::ComputeKey(fGpu, params, desc, ca cheID);
388 388
389 GrTexture* texture; 389 GrTexture* texture;
390 if (GrTextureImpl::NeedsResizing(resourceKey)) { 390 if (GrTextureImpl::NeedsResizing(resourceKey)) {
391 // We do not know how to resize compressed textures.
392 SkASSERT(!GrPixelConfigIsCompressed(desc.fConfig));
393
394 texture = this->createResizedTexture(desc, cacheID, 391 texture = this->createResizedTexture(desc, cacheID,
395 srcData, rowBytes, 392 srcData, rowBytes,
396 GrTextureImpl::NeedsBilerp(resource Key)); 393 GrTextureImpl::NeedsBilerp(resource Key));
397 } else { 394 } else {
398 texture = fGpu->createTexture(desc, srcData, rowBytes); 395 texture= fGpu->createTexture(desc, srcData, rowBytes);
399 } 396 }
400 397
401 if (NULL != texture) { 398 if (NULL != texture) {
402 // Adding a resource could put us overbudget. Try to free up the 399 // Adding a resource could put us overbudget. Try to free up the
403 // necessary space before adding it. 400 // necessary space before adding it.
404 fResourceCache->purgeAsNeeded(1, texture->gpuMemorySize()); 401 fResourceCache->purgeAsNeeded(1, texture->gpuMemorySize());
405 fResourceCache->addResource(resourceKey, texture); 402 fResourceCache->addResource(resourceKey, texture);
406 403
407 if (NULL != cacheKey) { 404 if (NULL != cacheKey) {
408 *cacheKey = resourceKey; 405 *cacheKey = resourceKey;
(...skipping 1429 matching lines...) Expand 10 before | Expand all | Expand 10 after
1838 SkSafeRef(resource); 1835 SkSafeRef(resource);
1839 return resource; 1836 return resource;
1840 } 1837 }
1841 1838
1842 /////////////////////////////////////////////////////////////////////////////// 1839 ///////////////////////////////////////////////////////////////////////////////
1843 #if GR_CACHE_STATS 1840 #if GR_CACHE_STATS
1844 void GrContext::printCacheStats() const { 1841 void GrContext::printCacheStats() const {
1845 fResourceCache->printStats(); 1842 fResourceCache->printStats();
1846 } 1843 }
1847 #endif 1844 #endif
OLDNEW
« no previous file with comments | « include/gpu/GrTypes.h ('k') | src/gpu/GrGpu.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698