aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl/GrGLTexture.cpp
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2018-07-30 13:13:17 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-07-30 19:32:13 +0000
commit7226c232d73356a37ec8cfef0ed55147e68dd2fd (patch)
tree47559e4a5994b5cffc5382e9bb230f49b6c04cd7 /src/gpu/gl/GrGLTexture.cpp
parent3ebd354730ea9590bf233deccfc24982ffe48a98 (diff)
Make GrTextureProxy store a GrTextureType.
Removes flag indicating rectangle or external as its now redundant. Bug: skia: Change-Id: Ia475b557390e7a6b0f19f6e189cf8c27090e397c Reviewed-on: https://skia-review.googlesource.com/144346 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/gl/GrGLTexture.cpp')
-rw-r--r--src/gpu/gl/GrGLTexture.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/gpu/gl/GrGLTexture.cpp b/src/gpu/gl/GrGLTexture.cpp
index f0fafabcba..200c8d22e8 100644
--- a/src/gpu/gl/GrGLTexture.cpp
+++ b/src/gpu/gl/GrGLTexture.cpp
@@ -15,7 +15,7 @@
#define GPUGL static_cast<GrGLGpu*>(this->getGpu())
#define GL_CALL(X) GR_GL_CALL(GPUGL->glInterface(), X)
-static inline GrTextureType texture_type_from_target(GrGLenum target) {
+GrTextureType GrGLTexture::TextureTypeFromTarget(GrGLenum target) {
switch (target) {
case GR_GL_TEXTURE_2D:
return GrTextureType::k2D;
@@ -55,7 +55,7 @@ static inline GrSamplerState::Filter highest_filter_mode(const GrGLTexture::IDDe
GrGLTexture::GrGLTexture(GrGLGpu* gpu, SkBudgeted budgeted, const GrSurfaceDesc& desc,
const IDDesc& idDesc, GrMipMapsStatus mipMapsStatus)
: GrSurface(gpu, desc)
- , INHERITED(gpu, desc, texture_type_from_target(idDesc.fInfo.fTarget),
+ , INHERITED(gpu, desc, TextureTypeFromTarget(idDesc.fInfo.fTarget),
highest_filter_mode(idDesc, desc.fConfig), mipMapsStatus) {
this->init(desc, idDesc);
this->registerWithCache(budgeted);
@@ -64,7 +64,7 @@ GrGLTexture::GrGLTexture(GrGLGpu* gpu, SkBudgeted budgeted, const GrSurfaceDesc&
GrGLTexture::GrGLTexture(GrGLGpu* gpu, Wrapped, const GrSurfaceDesc& desc,
GrMipMapsStatus mipMapsStatus, const IDDesc& idDesc)
: GrSurface(gpu, desc)
- , INHERITED(gpu, desc, texture_type_from_target(idDesc.fInfo.fTarget),
+ , INHERITED(gpu, desc, TextureTypeFromTarget(idDesc.fInfo.fTarget),
highest_filter_mode(idDesc, desc.fConfig), mipMapsStatus) {
this->init(desc, idDesc);
this->registerWithCacheWrapped();
@@ -73,7 +73,7 @@ GrGLTexture::GrGLTexture(GrGLGpu* gpu, Wrapped, const GrSurfaceDesc& desc,
GrGLTexture::GrGLTexture(GrGLGpu* gpu, const GrSurfaceDesc& desc, const IDDesc& idDesc,
GrMipMapsStatus mipMapsStatus)
: GrSurface(gpu, desc)
- , INHERITED(gpu, desc, texture_type_from_target(idDesc.fInfo.fTarget),
+ , INHERITED(gpu, desc, TextureTypeFromTarget(idDesc.fInfo.fTarget),
highest_filter_mode(idDesc, desc.fConfig), mipMapsStatus) {
this->init(desc, idDesc);
}
@@ -81,10 +81,6 @@ GrGLTexture::GrGLTexture(GrGLGpu* gpu, const GrSurfaceDesc& desc, const IDDesc&
void GrGLTexture::init(const GrSurfaceDesc& desc, const IDDesc& idDesc) {
SkASSERT(0 != idDesc.fInfo.fID);
SkASSERT(0 != idDesc.fInfo.fFormat);
- if (idDesc.fInfo.fTarget == GR_GL_TEXTURE_RECTANGLE ||
- idDesc.fInfo.fTarget == GR_GL_TEXTURE_EXTERNAL) {
- this->setIsGLTextureRectangleOrExternal();
- }
fTexParams.invalidate();
fTexParamsTimestamp = GrGpu::kExpiredTimestamp;
fID = idDesc.fInfo.fID;