OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 #include "GrRenderTarget.h" | 10 #include "GrRenderTarget.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 void GrRenderTarget::resolve() { | 50 void GrRenderTarget::resolve() { |
51 // go through context so that all necessary flushing occurs | 51 // go through context so that all necessary flushing occurs |
52 GrContext* context = this->getContext(); | 52 GrContext* context = this->getContext(); |
53 if (NULL == context) { | 53 if (NULL == context) { |
54 return; | 54 return; |
55 } | 55 } |
56 context->resolveRenderTarget(this); | 56 context->resolveRenderTarget(this); |
57 } | 57 } |
58 | 58 |
59 size_t GrRenderTarget::sizeInBytes() const { | 59 size_t GrRenderTarget::sizeInBytes() const { |
60 int colorBits; | 60 size_t colorBits; |
61 if (kUnknown_GrPixelConfig == fDesc.fConfig) { | 61 if (kUnknown_GrPixelConfig == fDesc.fConfig) { |
62 colorBits = 32; // don't know, make a guess | 62 colorBits = 32; // don't know, make a guess |
63 } else { | 63 } else { |
64 colorBits = GrBytesPerPixel(fDesc.fConfig); | 64 colorBits = GrBytesPerPixel(fDesc.fConfig); |
65 } | 65 } |
66 uint64_t size = fDesc.fWidth; | 66 uint64_t size = fDesc.fWidth; |
67 size *= fDesc.fHeight; | 67 size *= fDesc.fHeight; |
68 size *= colorBits; | 68 size *= colorBits; |
69 size *= GrMax(1, fDesc.fSampleCnt); | 69 size *= GrMax(1, fDesc.fSampleCnt); |
70 return (size_t)(size / 8); | 70 return (size_t)(size / 8); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 this->setStencilBuffer(NULL); | 102 this->setStencilBuffer(NULL); |
103 | 103 |
104 INHERITED::onRelease(); | 104 INHERITED::onRelease(); |
105 } | 105 } |
106 | 106 |
107 void GrRenderTarget::onAbandon() { | 107 void GrRenderTarget::onAbandon() { |
108 this->setStencilBuffer(NULL); | 108 this->setStencilBuffer(NULL); |
109 | 109 |
110 INHERITED::onAbandon(); | 110 INHERITED::onAbandon(); |
111 } | 111 } |
OLD | NEW |