aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrTextureProvider.cpp
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2016-11-10 11:19:51 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-11-10 17:13:34 +0000
commit434c534bd0ec08cb355fecfb6d2110197b523e74 (patch)
tree119167b88683157346ab8250bbc553903e046f7f /src/gpu/GrTextureProvider.cpp
parente13a69baac9dc326510009fa7c0c5966aee9240c (diff)
Add integer texture support.
This allows us to create integer textures and sample them from a GrProcessor's code. Filtering is limited to NEAREST. Adds tests for reading/writing pixels, copying, and drawing. These operations are not allowed to convert to fixed/float configs. Vulkan support is TBD. GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4348 Change-Id: If38d89a03285d4bd98d1f14f9638b0320977e43d Reviewed-on: https://skia-review.googlesource.com/4348 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Chris Dalton <csmartdalton@google.com>
Diffstat (limited to 'src/gpu/GrTextureProvider.cpp')
-rw-r--r--src/gpu/GrTextureProvider.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/gpu/GrTextureProvider.cpp b/src/gpu/GrTextureProvider.cpp
index dba24b5926..b49c2c96d6 100644
--- a/src/gpu/GrTextureProvider.cpp
+++ b/src/gpu/GrTextureProvider.cpp
@@ -48,7 +48,9 @@ GrTexture* GrTextureProvider::createMipMappedTexture(const GrSurfaceDesc& desc,
return nullptr;
}
}
-
+ if (mipLevelCount > 1 && GrPixelConfigIsSint(desc.fConfig)) {
+ return nullptr;
+ }
if ((desc.fFlags & kRenderTarget_GrSurfaceFlag) &&
!fGpu->caps()->isConfigRenderable(desc.fConfig, desc.fSampleCnt > 0)) {
return nullptr;
@@ -84,10 +86,10 @@ GrTexture* GrTextureProvider::createTexture(const GrSurfaceDesc& desc, SkBudgete
GrMipLevel* texels = nullptr;
int levelCount = 0;
if (srcData) {
- tempTexels.fPixels = srcData;
- tempTexels.fRowBytes = rowBytes;
- texels = &tempTexels;
- levelCount = 1;
+ tempTexels.fPixels = srcData;
+ tempTexels.fRowBytes = rowBytes;
+ texels = &tempTexels;
+ levelCount = 1;
}
return this->createMipMappedTexture(desc, budgeted, texels, levelCount);
}