| 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 } | 72 } |
| 73 uint64_t size = fDesc.fWidth; | 73 uint64_t size = fDesc.fWidth; |
| 74 size *= fDesc.fHeight; | 74 size *= fDesc.fHeight; |
| 75 size *= colorBits; | 75 size *= colorBits; |
| 76 size *= SkTMax(1, fDesc.fSampleCnt); | 76 size *= SkTMax(1, fDesc.fSampleCnt); |
| 77 return (size_t)(size / 8); | 77 return (size_t)(size / 8); |
| 78 } | 78 } |
| 79 | 79 |
| 80 void GrRenderTarget::flagAsNeedingResolve(const SkIRect* rect) { | 80 void GrRenderTarget::flagAsNeedingResolve(const SkIRect* rect) { |
| 81 if (kCanResolve_ResolveType == getResolveType()) { | 81 if (kCanResolve_ResolveType == getResolveType()) { |
| 82 if (NULL != rect) { | 82 if (rect) { |
| 83 fResolveRect.join(*rect); | 83 fResolveRect.join(*rect); |
| 84 if (!fResolveRect.intersect(0, 0, this->width(), this->height())) { | 84 if (!fResolveRect.intersect(0, 0, this->width(), this->height())) { |
| 85 fResolveRect.setEmpty(); | 85 fResolveRect.setEmpty(); |
| 86 } | 86 } |
| 87 } else { | 87 } else { |
| 88 fResolveRect.setLTRB(0, 0, this->width(), this->height()); | 88 fResolveRect.setLTRB(0, 0, this->width(), this->height()); |
| 89 } | 89 } |
| 90 } | 90 } |
| 91 } | 91 } |
| 92 | 92 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 109 this->setStencilBuffer(NULL); | 109 this->setStencilBuffer(NULL); |
| 110 | 110 |
| 111 INHERITED::onRelease(); | 111 INHERITED::onRelease(); |
| 112 } | 112 } |
| 113 | 113 |
| 114 void GrRenderTarget::onAbandon() { | 114 void GrRenderTarget::onAbandon() { |
| 115 this->setStencilBuffer(NULL); | 115 this->setStencilBuffer(NULL); |
| 116 | 116 |
| 117 INHERITED::onAbandon(); | 117 INHERITED::onAbandon(); |
| 118 } | 118 } |
| OLD | NEW |