| 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 29 matching lines...) Expand all Loading... |
| 40 fRTLifecycle = idDesc.fLifeCycle; | 40 fRTLifecycle = idDesc.fLifeCycle; |
| 41 | 41 |
| 42 fViewport.fLeft = 0; | 42 fViewport.fLeft = 0; |
| 43 fViewport.fBottom = 0; | 43 fViewport.fBottom = 0; |
| 44 fViewport.fWidth = desc.fWidth; | 44 fViewport.fWidth = desc.fWidth; |
| 45 fViewport.fHeight = desc.fHeight; | 45 fViewport.fHeight = desc.fHeight; |
| 46 | 46 |
| 47 fGpuMemorySize = this->totalSamples() * this->totalBytesPerSample(); | 47 fGpuMemorySize = this->totalSamples() * this->totalBytesPerSample(); |
| 48 | 48 |
| 49 SkASSERT(fGpuMemorySize <= WorseCaseSize(desc)); | 49 SkASSERT(fGpuMemorySize <= WorseCaseSize(desc)); |
| 50 |
| 51 fSampleLocationsConfig = kDefault_SampleLocationsConfig; |
| 50 } | 52 } |
| 51 | 53 |
| 52 GrGLRenderTarget* GrGLRenderTarget::CreateWrapped(GrGLGpu* gpu, | 54 GrGLRenderTarget* GrGLRenderTarget::CreateWrapped(GrGLGpu* gpu, |
| 53 const GrSurfaceDesc& desc, | 55 const GrSurfaceDesc& desc, |
| 54 const IDDesc& idDesc, | 56 const IDDesc& idDesc, |
| 55 int stencilBits) { | 57 int stencilBits) { |
| 56 GrGLStencilAttachment* sb = nullptr; | 58 GrGLStencilAttachment* sb = nullptr; |
| 57 if (stencilBits) { | 59 if (stencilBits) { |
| 58 GrGLStencilAttachment::IDDesc sbDesc; | 60 GrGLStencilAttachment::IDDesc sbDesc; |
| 59 GrGLStencilAttachment::Format format; | 61 GrGLStencilAttachment::Format format; |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 int GrGLRenderTarget::totalSamples() const { | 202 int GrGLRenderTarget::totalSamples() const { |
| 201 int total_samples = this->msaaSamples(); | 203 int total_samples = this->msaaSamples(); |
| 202 | 204 |
| 203 if (fTexFBOID != kUnresolvableFBOID) { | 205 if (fTexFBOID != kUnresolvableFBOID) { |
| 204 // If we own the resolve buffer then that is one more sample per pixel. | 206 // If we own the resolve buffer then that is one more sample per pixel. |
| 205 total_samples += 1; | 207 total_samples += 1; |
| 206 } | 208 } |
| 207 | 209 |
| 208 return total_samples; | 210 return total_samples; |
| 209 } | 211 } |
| OLD | NEW |