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 "GrGLGpu.h" | 10 #include "GrGLGpu.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 fMSColorRenderbufferID = idDesc.fMSColorRenderbufferID; | 54 fMSColorRenderbufferID = idDesc.fMSColorRenderbufferID; |
55 fRTFBOOwnership = idDesc.fRTFBOOwnership; | 55 fRTFBOOwnership = idDesc.fRTFBOOwnership; |
56 | 56 |
57 fViewport.fLeft = 0; | 57 fViewport.fLeft = 0; |
58 fViewport.fBottom = 0; | 58 fViewport.fBottom = 0; |
59 fViewport.fWidth = desc.fWidth; | 59 fViewport.fWidth = desc.fWidth; |
60 fViewport.fHeight = desc.fHeight; | 60 fViewport.fHeight = desc.fHeight; |
61 | 61 |
62 fGpuMemorySize = this->totalSamples() * this->totalBytesPerSample(); | 62 fGpuMemorySize = this->totalSamples() * this->totalBytesPerSample(); |
63 | 63 |
64 SkASSERT(fGpuMemorySize <= WorseCaseSize(desc)); | 64 SkASSERT(fGpuMemorySize <= WorstCaseSize(desc)); |
65 } | 65 } |
66 | 66 |
67 GrGLRenderTarget* GrGLRenderTarget::CreateWrapped(GrGLGpu* gpu, | 67 GrGLRenderTarget* GrGLRenderTarget::CreateWrapped(GrGLGpu* gpu, |
68 const GrSurfaceDesc& desc, | 68 const GrSurfaceDesc& desc, |
69 const IDDesc& idDesc, | 69 const IDDesc& idDesc, |
70 int stencilBits) { | 70 int stencilBits) { |
71 GrGLStencilAttachment* sb = nullptr; | 71 GrGLStencilAttachment* sb = nullptr; |
72 if (stencilBits) { | 72 if (stencilBits) { |
73 GrGLStencilAttachment::IDDesc sbDesc; | 73 GrGLStencilAttachment::IDDesc sbDesc; |
74 GrGLStencilAttachment::Format format; | 74 GrGLStencilAttachment::Format format; |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 int GrGLRenderTarget::totalSamples() const { | 230 int GrGLRenderTarget::totalSamples() const { |
231 int total_samples = this->msaaSamples(); | 231 int total_samples = this->msaaSamples(); |
232 | 232 |
233 if (fTexFBOID != kUnresolvableFBOID) { | 233 if (fTexFBOID != kUnresolvableFBOID) { |
234 // If we own the resolve buffer then that is one more sample per pixel. | 234 // If we own the resolve buffer then that is one more sample per pixel. |
235 total_samples += 1; | 235 total_samples += 1; |
236 } | 236 } |
237 | 237 |
238 return total_samples; | 238 return total_samples; |
239 } | 239 } |
OLD | NEW |