Remove some unneeded calls to GrGLGpu::configToGLFormats
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1530313005
Review URL: https://codereview.chromium.org/1530313005
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp
index 06405aa..ecb576f 100644
--- a/src/gpu/gl/GrGLGpu.cpp
+++ b/src/gpu/gl/GrGLGpu.cpp
@@ -415,9 +415,6 @@
GrTexture* GrGLGpu::onWrapBackendTexture(const GrBackendTextureDesc& desc,
GrWrapOwnership ownership) {
- if (!this->configToGLFormats(desc.fConfig, false, nullptr, nullptr, nullptr)) {
- return nullptr;
- }
#ifdef SK_IGNORE_GL_TEXTURE_TARGET
if (!desc.fTextureHandle) {
return nullptr;
@@ -800,6 +797,7 @@
const void* data,
bool isNewTexture,
int left, int top, int width, int height) {
+ SkASSERT(this->caps()->isConfigTexturable(desc.fConfig));
SkASSERT(data || isNewTexture);
// No support for software flip y, yet...
@@ -827,11 +825,9 @@
// is a multiple of the block size.
size_t dataSize = GrCompressedFormatDataSize(desc.fConfig, width, height);
- // We only need the internal format for compressed 2D textures.
- GrGLenum internalFormat = 0;
- if (!this->configToGLFormats(desc.fConfig, false, &internalFormat, nullptr, nullptr)) {
- return false;
- }
+ // We only need the internal format for compressed 2D textures. There is on
+ // sized vs base internal format distinction for compressed textures.
+ GrGLenum internalFormat = fConfigTable[desc.fConfig].fSizedInternalFormat;
if (isNewTexture) {
CLEAR_ERROR_BEFORE_ALLOC(this->glInterface());
@@ -1971,12 +1967,9 @@
return false;
}
- GrGLenum format = 0;
- GrGLenum type = 0;
+ GrGLenum format = fConfigTable[config].fExternalFormat;
+ GrGLenum type = fConfigTable[config].fExternalType;
bool flipY = kBottomLeft_GrSurfaceOrigin == surface->origin();
- if (!this->configToGLFormats(config, false, nullptr, &format, &type)) {
- return false;
- }
// resolve the render target if necessary
switch (tgt->getResolveType()) {