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 | 8 |
9 #include "GrRenderTarget.h" | 9 #include "GrRenderTarget.h" |
10 | 10 |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 } | 98 } |
99 return true; | 99 return true; |
100 } | 100 } |
101 | 101 |
102 int GrRenderTargetPriv::numStencilBits() const { | 102 int GrRenderTargetPriv::numStencilBits() const { |
103 return fRenderTarget->fStencilAttachment ? fRenderTarget->fStencilAttachment
->bits() : 0; | 103 return fRenderTarget->fStencilAttachment ? fRenderTarget->fStencilAttachment
->bits() : 0; |
104 } | 104 } |
105 | 105 |
106 const GrGpu::MultisampleSpecs& | 106 const GrGpu::MultisampleSpecs& |
107 GrRenderTargetPriv::getMultisampleSpecs(const GrStencilSettings& stencil) const
{ | 107 GrRenderTargetPriv::getMultisampleSpecs(const GrStencilSettings& stencil) const
{ |
108 return fRenderTarget->getGpu()->getMultisampleSpecs(fRenderTarget, stencil); | 108 GrGpu* gpu = fRenderTarget->getGpu(); |
| 109 if (auto id = fRenderTarget->fMultisampleSpecsID) { |
| 110 SkASSERT(gpu->queryMultisampleSpecs(fRenderTarget, stencil).fUniqueID ==
id); |
| 111 return gpu->getMultisampleSpecs(id); |
| 112 } |
| 113 const GrGpu::MultisampleSpecs& specs = gpu->queryMultisampleSpecs(fRenderTar
get, stencil); |
| 114 fRenderTarget->fMultisampleSpecsID = specs.fUniqueID; |
| 115 return specs; |
109 } | 116 } |
110 | 117 |
111 int GrRenderTargetPriv::maxWindowRectangles() const { | 118 int GrRenderTargetPriv::maxWindowRectangles() const { |
112 return (this->flags() & Flags::kWindowRectsSupport) ? | 119 return (this->flags() & Flags::kWindowRectsSupport) ? |
113 fRenderTarget->getGpu()->caps()->maxWindowRectangles() : 0; | 120 fRenderTarget->getGpu()->caps()->maxWindowRectangles() : 0; |
114 } | 121 } |
OLD | NEW |