| 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 22 matching lines...) Expand all Loading... |
| 33 fMSColorRenderbufferID = idDesc.fMSColorRenderbufferID; | 33 fMSColorRenderbufferID = idDesc.fMSColorRenderbufferID; |
| 34 fRTLifecycle = idDesc.fLifeCycle; | 34 fRTLifecycle = idDesc.fLifeCycle; |
| 35 | 35 |
| 36 fViewport.fLeft = 0; | 36 fViewport.fLeft = 0; |
| 37 fViewport.fBottom = 0; | 37 fViewport.fBottom = 0; |
| 38 fViewport.fWidth = desc.fWidth; | 38 fViewport.fWidth = desc.fWidth; |
| 39 fViewport.fHeight = desc.fHeight; | 39 fViewport.fHeight = desc.fHeight; |
| 40 | 40 |
| 41 // We own one color value for each MSAA sample. | 41 // We own one color value for each MSAA sample. |
| 42 int colorValuesPerPixel = SkTMax(1, fDesc.fSampleCnt); | 42 int colorValuesPerPixel = SkTMax(1, fDesc.fSampleCnt); |
| 43 if (fTexFBOID != fRTFBOID) { | 43 if (fTexFBOID != kUnresolvableFBOID && fTexFBOID != fRTFBOID) { |
| 44 // If we own the resolve buffer then that is one more sample per pixel. | 44 // If we own the resolve buffer then that is one more sample per pixel. |
| 45 colorValuesPerPixel += 1; | 45 colorValuesPerPixel += 1; |
| 46 } else if (fTexFBOID != 0) { | 46 } else if (fTexFBOID != 0) { |
| 47 // For auto-resolving FBOs, the MSAA buffer is free. | 47 // For auto-resolving FBOs, the MSAA buffer is free. |
| 48 colorValuesPerPixel = 1; | 48 colorValuesPerPixel = 1; |
| 49 } | 49 } |
| 50 SkASSERT(kUnknown_GrPixelConfig != fDesc.fConfig); | 50 SkASSERT(kUnknown_GrPixelConfig != fDesc.fConfig); |
| 51 SkASSERT(!GrPixelConfigIsCompressed(fDesc.fConfig)); | 51 SkASSERT(!GrPixelConfigIsCompressed(fDesc.fConfig)); |
| 52 size_t colorBytes = GrBytesPerPixel(fDesc.fConfig); | 52 size_t colorBytes = GrBytesPerPixel(fDesc.fConfig); |
| 53 SkASSERT(colorBytes > 0); | 53 SkASSERT(colorBytes > 0); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 75 fMSColorRenderbufferID = 0; | 75 fMSColorRenderbufferID = 0; |
| 76 INHERITED::onRelease(); | 76 INHERITED::onRelease(); |
| 77 } | 77 } |
| 78 | 78 |
| 79 void GrGLRenderTarget::onAbandon() { | 79 void GrGLRenderTarget::onAbandon() { |
| 80 fRTFBOID = 0; | 80 fRTFBOID = 0; |
| 81 fTexFBOID = 0; | 81 fTexFBOID = 0; |
| 82 fMSColorRenderbufferID = 0; | 82 fMSColorRenderbufferID = 0; |
| 83 INHERITED::onAbandon(); | 83 INHERITED::onAbandon(); |
| 84 } | 84 } |
| OLD | NEW |