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

Unified Diff: src/gpu/GrContext.cpp

Issue 302783002: Initial work to get ETC1 data up to the GPU (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix GCC warning Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: src/gpu/GrContext.cpp
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index 5a59bc17fdfbddc45fc0919d88cbb808162ff826..005d7e785e6dc1cd29d3b1fdd0c894576364f1d2 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -388,11 +388,18 @@ GrTexture* GrContext::createTexture(const GrTextureParams* params,
GrTexture* texture;
if (GrTextureImpl::NeedsResizing(resourceKey)) {
+ // We do not know how to resize compressed textures.
+ SkASSERT(!GrPixelConfigIsCompressed(desc.fConfig));
+
texture = this->createResizedTexture(desc, cacheID,
srcData, rowBytes,
GrTextureImpl::NeedsBilerp(resourceKey));
} else {
- texture= fGpu->createTexture(desc, srcData, rowBytes);
+ if(GrPixelConfigIsCompressed(desc.fConfig)) {
+ texture = fGpu->createCompressedTexture(desc, srcData);
+ } else {
+ texture = fGpu->createTexture(desc, srcData, rowBytes);
+ }
}
if (NULL != texture) {

Powered by Google App Engine
This is Rietveld 408576698