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

Unified Diff: src/gpu/GrGpu.cpp

Issue 1531343002: Add fExternalFormatForTexImage to GrGLGpu::ConfigEntry. Use it in GrGLGpu::uploadTexData. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update comment Created 5 years 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
« no previous file with comments | « no previous file | src/gpu/gl/GrGLGpu.h » ('j') | src/gpu/gl/GrGLGpu.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrGpu.cpp
diff --git a/src/gpu/GrGpu.cpp b/src/gpu/GrGpu.cpp
index a9b283f3cec8a836a743a2078bd5d6a95da31ada..e2457ce31e4f47325e81ba1c3f744678e1399c24 100644
--- a/src/gpu/GrGpu.cpp
+++ b/src/gpu/GrGpu.cpp
@@ -160,6 +160,13 @@ GrTexture* GrGpu::createTexture(const GrSurfaceDesc& origDesc, bool budgeted,
GrTexture* GrGpu::wrapBackendTexture(const GrBackendTextureDesc& desc, GrWrapOwnership ownership) {
this->handleDirtyContext();
+ if (!this->caps()->isConfigTexturable(desc.fConfig)) {
+ return nullptr;
+ }
+ if ((desc.fFlags & kRenderTarget_GrBackendTextureFlag) &&
+ !this->caps()->isConfigRenderable(desc.fConfig, desc.fSampleCnt > 0)) {
+ return nullptr;
+ }
GrTexture* tex = this->onWrapBackendTexture(desc, ownership);
if (nullptr == tex) {
return nullptr;
@@ -176,6 +183,9 @@ GrTexture* GrGpu::wrapBackendTexture(const GrBackendTextureDesc& desc, GrWrapOwn
GrRenderTarget* GrGpu::wrapBackendRenderTarget(const GrBackendRenderTargetDesc& desc,
GrWrapOwnership ownership) {
+ if (!this->caps()->isConfigRenderable(desc.fConfig, desc.fSampleCnt > 0)) {
+ return nullptr;
+ }
this->handleDirtyContext();
return this->onWrapBackendRenderTarget(desc, ownership);
}
« no previous file with comments | « no previous file | src/gpu/gl/GrGLGpu.h » ('j') | src/gpu/gl/GrGLGpu.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698