rename GrTextureDesc->GrSurfaceDesc, GrTextureFlags->GrSurfaceFlags
Review URL: https://codereview.chromium.org/682223002
diff --git a/src/gpu/gl/GrGLRenderTarget.cpp b/src/gpu/gl/GrGLRenderTarget.cpp
index 49186bf..bcf6d71 100644
--- a/src/gpu/gl/GrGLRenderTarget.cpp
+++ b/src/gpu/gl/GrGLRenderTarget.cpp
@@ -25,11 +25,11 @@
}
namespace {
-GrTextureDesc MakeDesc(GrTextureFlags flags,
+GrSurfaceDesc MakeDesc(GrSurfaceFlags flags,
int width, int height,
GrPixelConfig config, int sampleCnt,
GrSurfaceOrigin origin) {
- GrTextureDesc temp;
+ GrSurfaceDesc temp;
temp.fFlags = flags;
temp.fWidth = width;
temp.fHeight = height;
@@ -49,7 +49,7 @@
: INHERITED(gpu,
desc.fIsWrapped,
texture,
- MakeDesc(kNone_GrTextureFlags,
+ MakeDesc(kNone_GrSurfaceFlags,
viewport.fWidth, viewport.fHeight,
desc.fConfig, desc.fSampleCnt,
desc.fOrigin)) {
@@ -72,7 +72,7 @@
: INHERITED(gpu,
desc.fIsWrapped,
NULL,
- MakeDesc(kNone_GrTextureFlags,
+ MakeDesc(kNone_GrSurfaceFlags,
viewport.fWidth, viewport.fHeight,
desc.fConfig, desc.fSampleCnt,
desc.fOrigin)) {
diff --git a/src/gpu/gl/GrGLTexture.h b/src/gpu/gl/GrGLTexture.h
index 05acaa8..4f107aa 100644
--- a/src/gpu/gl/GrGLTexture.h
+++ b/src/gpu/gl/GrGLTexture.h
@@ -57,7 +57,7 @@
void invalidate() { memset(this, 0xff, sizeof(TexParams)); }
};
- struct Desc : public GrTextureDesc {
+ struct Desc : public GrSurfaceDesc {
GrGLuint fTextureID;
bool fIsWrapped;
};
diff --git a/src/gpu/gl/GrGpuGL.cpp b/src/gpu/gl/GrGpuGL.cpp
index a85548e..b9cb2da 100644
--- a/src/gpu/gl/GrGpuGL.cpp
+++ b/src/gpu/gl/GrGpuGL.cpp
@@ -376,7 +376,7 @@
GrGLTexture::Desc glTexDesc;
// next line relies on GrBackendTextureDesc's flags matching GrTexture's
- glTexDesc.fFlags = (GrTextureFlags) desc.fFlags;
+ glTexDesc.fFlags = (GrSurfaceFlags) desc.fFlags;
glTexDesc.fWidth = desc.fWidth;
glTexDesc.fHeight = desc.fHeight;
glTexDesc.fConfig = desc.fConfig;
@@ -530,8 +530,8 @@
return true;
}
-GrGLenum check_alloc_error(const GrTextureDesc& desc, const GrGLInterface* interface) {
- if (SkToBool(desc.fFlags & kCheckAllocation_GrTextureFlagBit)) {
+GrGLenum check_alloc_error(const GrSurfaceDesc& desc, const GrGLInterface* interface) {
+ if (SkToBool(desc.fFlags & kCheckAllocation_GrSurfaceFlag)) {
return GR_GL_GET_ERROR(interface);
} else {
return CHECK_ALLOC_ERROR(interface);
@@ -941,7 +941,7 @@
}
#endif
-GrTexture* GrGpuGL::onCreateTexture(const GrTextureDesc& desc,
+GrTexture* GrGpuGL::onCreateTexture(const GrSurfaceDesc& desc,
const void* srcData,
size_t rowBytes) {
@@ -969,9 +969,9 @@
glRTDesc.fTexFBOID = 0;
glRTDesc.fIsWrapped = false;
glRTDesc.fConfig = glTexDesc.fConfig;
- glRTDesc.fCheckAllocation = SkToBool(desc.fFlags & kCheckAllocation_GrTextureFlagBit);
+ glRTDesc.fCheckAllocation = SkToBool(desc.fFlags & kCheckAllocation_GrSurfaceFlag);
- bool renderTarget = SkToBool(desc.fFlags & kRenderTarget_GrTextureFlagBit);
+ bool renderTarget = SkToBool(desc.fFlags & kRenderTarget_GrSurfaceFlag);
glTexDesc.fOrigin = resolve_origin(desc.fOrigin, renderTarget);
glRTDesc.fOrigin = glTexDesc.fOrigin;
@@ -1064,10 +1064,10 @@
return tex;
}
-GrTexture* GrGpuGL::onCreateCompressedTexture(const GrTextureDesc& desc,
+GrTexture* GrGpuGL::onCreateCompressedTexture(const GrSurfaceDesc& desc,
const void* srcData) {
- if(SkToBool(desc.fFlags & kRenderTarget_GrTextureFlagBit)) {
+ if(SkToBool(desc.fFlags & kRenderTarget_GrSurfaceFlag)) {
return return_null_texture();
}
@@ -2411,7 +2411,7 @@
return tempFBOID;
}
-void GrGpuGL::initCopySurfaceDstDesc(const GrSurface* src, GrTextureDesc* desc) {
+void GrGpuGL::initCopySurfaceDstDesc(const GrSurface* src, GrSurfaceDesc* desc) {
// Check for format issues with glCopyTexSubImage2D
if (kGLES_GrGLStandard == this->glStandard() && this->glCaps().bgraIsInternalFormat() &&
kBGRA_8888_GrPixelConfig == src->config()) {
@@ -2433,7 +2433,7 @@
} else {
desc->fConfig = src->config();
desc->fOrigin = src->origin();
- desc->fFlags = kNone_GrTextureFlags;
+ desc->fFlags = kNone_GrSurfaceFlags;
}
}
diff --git a/src/gpu/gl/GrGpuGL.h b/src/gpu/gl/GrGpuGL.h
index dc0d076..808f97a 100644
--- a/src/gpu/gl/GrGpuGL.h
+++ b/src/gpu/gl/GrGpuGL.h
@@ -68,7 +68,7 @@
size_t rowBytes) const SK_OVERRIDE;
virtual bool fullReadPixelsIsFasterThanPartial() const SK_OVERRIDE;
- virtual void initCopySurfaceDstDesc(const GrSurface* src, GrTextureDesc* desc) SK_OVERRIDE;
+ virtual void initCopySurfaceDstDesc(const GrSurface* src, GrSurfaceDesc* desc) SK_OVERRIDE;
// These functions should be used to bind GL objects. They track the GL state and skip redundant
// bindings. Making the equivalent glBind calls directly will confuse the state tracking.
@@ -109,10 +109,10 @@
// GrGpu overrides
virtual void onResetContext(uint32_t resetBits) SK_OVERRIDE;
- virtual GrTexture* onCreateTexture(const GrTextureDesc& desc,
+ virtual GrTexture* onCreateTexture(const GrSurfaceDesc& desc,
const void* srcData,
size_t rowBytes) SK_OVERRIDE;
- virtual GrTexture* onCreateCompressedTexture(const GrTextureDesc& desc,
+ virtual GrTexture* onCreateCompressedTexture(const GrSurfaceDesc& desc,
const void* srcData) SK_OVERRIDE;
virtual GrVertexBuffer* onCreateVertexBuffer(size_t size, bool dynamic) SK_OVERRIDE;
virtual GrIndexBuffer* onCreateIndexBuffer(size_t size, bool dynamic) SK_OVERRIDE;