| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "GrGLRenderTarget.h" | 8 #include "GrGLRenderTarget.h" |
| 9 | 9 |
| 10 #include "GrRenderTargetPriv.h" | 10 #include "GrRenderTargetPriv.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 } | 27 } |
| 28 | 28 |
| 29 GrGLRenderTarget::GrGLRenderTarget(GrGLGpu* gpu, const GrSurfaceDesc& desc, cons
t IDDesc& idDesc, | 29 GrGLRenderTarget::GrGLRenderTarget(GrGLGpu* gpu, const GrSurfaceDesc& desc, cons
t IDDesc& idDesc, |
| 30 Derived) | 30 Derived) |
| 31 : GrSurface(gpu, idDesc.fLifeCycle, desc) | 31 : GrSurface(gpu, idDesc.fLifeCycle, desc) |
| 32 , INHERITED(gpu, idDesc.fLifeCycle, desc, idDesc.fSampleConfig) { | 32 , INHERITED(gpu, idDesc.fLifeCycle, desc, idDesc.fSampleConfig) { |
| 33 this->init(desc, idDesc); | 33 this->init(desc, idDesc); |
| 34 } | 34 } |
| 35 | 35 |
| 36 void GrGLRenderTarget::init(const GrSurfaceDesc& desc, const IDDesc& idDesc) { | 36 void GrGLRenderTarget::init(const GrSurfaceDesc& desc, const IDDesc& idDesc) { |
| 37 fRTFBOID = idDesc.fRTFBOID; | 37 fRTFBOID = idDesc.fRTFBOID; |
| 38 fTexFBOID = idDesc.fTexFBOID; | 38 fTexFBOID = idDesc.fTexFBOID; |
| 39 fMSColorRenderbufferID = idDesc.fMSColorRenderbufferID; | 39 fMSColorRenderbufferID = idDesc.fMSColorRenderbufferID; |
| 40 fRTLifecycle = idDesc.fLifeCycle; | 40 fRTLifecycle = idDesc.fLifeCycle; |
| 41 fHasCoCenteredSamplesTimestamp = GrGpu::kExpiredTimestamp; |
| 41 | 42 |
| 42 fViewport.fLeft = 0; | 43 fViewport.fLeft = 0; |
| 43 fViewport.fBottom = 0; | 44 fViewport.fBottom = 0; |
| 44 fViewport.fWidth = desc.fWidth; | 45 fViewport.fWidth = desc.fWidth; |
| 45 fViewport.fHeight = desc.fHeight; | 46 fViewport.fHeight = desc.fHeight; |
| 46 | 47 |
| 47 fGpuMemorySize = this->totalSamples() * this->totalBytesPerSample(); | 48 fGpuMemorySize = this->totalSamples() * this->totalBytesPerSample(); |
| 48 | 49 |
| 49 SkASSERT(fGpuMemorySize <= WorseCaseSize(desc)); | 50 SkASSERT(fGpuMemorySize <= WorseCaseSize(desc)); |
| 50 } | 51 } |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 int GrGLRenderTarget::totalSamples() const { | 201 int GrGLRenderTarget::totalSamples() const { |
| 201 int total_samples = this->msaaSamples(); | 202 int total_samples = this->msaaSamples(); |
| 202 | 203 |
| 203 if (fTexFBOID != kUnresolvableFBOID) { | 204 if (fTexFBOID != kUnresolvableFBOID) { |
| 204 // If we own the resolve buffer then that is one more sample per pixel. | 205 // If we own the resolve buffer then that is one more sample per pixel. |
| 205 total_samples += 1; | 206 total_samples += 1; |
| 206 } | 207 } |
| 207 | 208 |
| 208 return total_samples; | 209 return total_samples; |
| 209 } | 210 } |
| OLD | NEW |