aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl/GrGLGpu.cpp
diff options
context:
space:
mode:
authorGravatar Greg Daniel <egdaniel@google.com>2018-04-12 16:50:17 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-04-12 21:40:11 +0000
commit92cbf3fc0112c99ec4aea9d8b7550a2573463262 (patch)
tree5dcec51815cd729db1f917b13dc5d185c1899a09 /src/gpu/gl/GrGLGpu.cpp
parent5f3ce3e43a56d9739ef5c2c12e889efd8e120659 (diff)
Don't create lazy proxys if their width/height is greater than max tex size
Bug: skia: Change-Id: I53508c4e3bbd4c315be4b29a66716e0c5e7f25bf Reviewed-on: https://skia-review.googlesource.com/121161 Reviewed-by: Robert Phillips <robertphillips@google.com> Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/gl/GrGLGpu.cpp')
-rw-r--r--src/gpu/gl/GrGLGpu.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp
index e162d83f3f..1cf60d8ffd 100644
--- a/src/gpu/gl/GrGLGpu.cpp
+++ b/src/gpu/gl/GrGLGpu.cpp
@@ -4346,6 +4346,10 @@ GrBackendTexture GrGLGpu::createTestingOnlyBackendTexture(const void* pixels, in
return GrBackendTexture(); // invalid
}
+ if (w > this->caps()->maxTextureSize() || h > this->caps()->maxTextureSize()) {
+ return GrBackendTexture(); // invalid
+ }
+
// Currently we don't support uploading pixel data when mipped.
if (pixels && GrMipMapped::kYes == mipMapped) {
return GrBackendTexture(); // invalid
@@ -4433,6 +4437,9 @@ void GrGLGpu::deleteTestingOnlyBackendTexture(const GrBackendTexture& tex) {
GrBackendRenderTarget GrGLGpu::createTestingOnlyBackendRenderTarget(int w, int h,
GrColorType colorType,
GrSRGBEncoded srgbEncoded) {
+ if (w > this->caps()->maxRenderTargetSize() || h > this->caps()->maxRenderTargetSize()) {
+ return GrBackendRenderTarget(); // invalid
+ }
this->handleDirtyContext();
auto config = GrColorTypeToPixelConfig(colorType, srgbEncoded);
GrGLenum colorBufferFormat;