Chromium Code Reviews| Index: src/gpu/gl/GrGLTexture.cpp |
| diff --git a/src/gpu/gl/GrGLTexture.cpp b/src/gpu/gl/GrGLTexture.cpp |
| index 8cf574ba15bb2d15bce3ce5e49d7534e4bab892c..b46bc02444a0216153576206063f97e9180bc6e4 100644 |
| --- a/src/gpu/gl/GrGLTexture.cpp |
| +++ b/src/gpu/gl/GrGLTexture.cpp |
| @@ -8,46 +8,22 @@ |
| #include "GrGLTexture.h" |
| #include "GrGpuGL.h" |
| -#define GPUGL static_cast<GrGpuGL*>(getGpu()) |
| - |
| +#define GPUGL static_cast<GrGpuGL*>(this->getGpu()) |
| #define GL_CALL(X) GR_GL_CALL(GPUGL->glInterface(), X) |
| -void GrGLTexture::init(GrGpuGL* gpu, |
| - const GrSurfaceDesc& desc, |
| - const IDDesc& idDesc, |
| - const GrGLRenderTarget::IDDesc* rtIDDesc) { |
| +GrGLTexture::GrGLTexture(GrGpuGL* gpu, const GrSurfaceDesc& desc, const IDDesc& idDesc) |
| + : GrGLTexture(gpu, desc, idDesc, kDerived) { |
| + this->registerWithCache(); |
| +} |
| +GrGLTexture::GrGLTexture(GrGpuGL* gpu, const GrSurfaceDesc& desc, const IDDesc& idDesc, Derived) |
|
robertphillips
2014/11/03 13:58:54
move GrSurface ctor call to its own line ?
// GrT
bsalomon
2014/11/03 15:20:14
Done.
|
| + : INHERITED(gpu, idDesc.fIsWrapped, desc), GrSurface(gpu, idDesc.fIsWrapped, desc) { |
| SkASSERT(0 != idDesc.fTextureID); |
| - |
| fTexParams.invalidate(); |
| fTexParamsTimestamp = GrGpu::kExpiredTimestamp; |
| fTexIDObj.reset(SkNEW_ARGS(GrGLTexID, (GPUGL->glInterface(), |
| idDesc.fTextureID, |
| idDesc.fIsWrapped))); |
| - |
| - if (rtIDDesc) { |
| - GrGLIRect vp; |
| - vp.fLeft = 0; |
| - vp.fWidth = desc.fWidth; |
| - vp.fBottom = 0; |
| - vp.fHeight = desc.fHeight; |
| - |
| - fRenderTarget.reset(SkNEW_ARGS(GrGLRenderTarget, (gpu, *rtIDDesc, vp, fTexIDObj, this))); |
| - } |
| - this->registerWithCache(); |
| -} |
| - |
| -GrGLTexture::GrGLTexture(GrGpuGL* gpu, const GrSurfaceDesc& desc, const IDDesc& idDesc) |
| - : INHERITED(gpu, idDesc.fIsWrapped, desc) { |
| - this->init(gpu, desc, idDesc, NULL); |
| -} |
| - |
| -GrGLTexture::GrGLTexture(GrGpuGL* gpu, |
| - const GrSurfaceDesc& desc, |
| - const IDDesc& idDesc, |
| - const GrGLRenderTarget::IDDesc& rtIDDesc) |
| - : INHERITED(gpu, idDesc.fIsWrapped, desc) { |
| - this->init(gpu, desc, idDesc, &rtIDDesc); |
| } |
| void GrGLTexture::onRelease() { |