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

Unified Diff: src/gpu/gl/GrGLGpu.cpp

Issue 1530313005: Remove some unneeded calls to GrGLGpu::configToGLFormats (Closed) Base URL: https://skia.googlesource.com/skia.git@internalFormat
Patch Set: 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLGpu.cpp
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp
index 06405aa7d07255712936d6b19775624968c1eec8..ecb576f0c5578ea8d99e170e26d46fece00b6844 100644
--- a/src/gpu/gl/GrGLGpu.cpp
+++ b/src/gpu/gl/GrGLGpu.cpp
@@ -415,9 +415,6 @@ static GrSurfaceOrigin resolve_origin(GrSurfaceOrigin origin, bool renderTarget)
GrTexture* GrGLGpu::onWrapBackendTexture(const GrBackendTextureDesc& desc,
bsalomon 2015/12/18 01:24:20 Base class checks that config is texturable.
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 @@ bool GrGLGpu::uploadCompressedTexData(const GrSurfaceDesc& desc,
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 @@ bool GrGLGpu::uploadCompressedTexData(const GrSurfaceDesc& desc,
// 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 @@ bool GrGLGpu::onReadPixels(GrSurface* surface,
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()) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698