OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 "GrDrawContext.h" | 8 #include "GrDrawContext.h" |
9 #include "GrDrawingManager.h" | 9 #include "GrDrawingManager.h" |
10 #include "GrDrawTarget.h" | 10 #include "GrDrawTarget.h" |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 return nullptr; | 119 return nullptr; |
120 } | 120 } |
121 | 121 |
122 bool useDIF = props.isUseDeviceIndependentFonts(); | 122 bool useDIF = props.isUseDeviceIndependentFonts(); |
123 | 123 |
124 if (useDIF && fContext->caps()->shaderCaps()->pathRenderingSupport() && | 124 if (useDIF && fContext->caps()->shaderCaps()->pathRenderingSupport() && |
125 rt->isStencilBufferMultisampled()) { | 125 rt->isStencilBufferMultisampled()) { |
126 GrStencilAttachment* sb = fContext->resourceProvider()->attachStencilAtt
achment(rt); | 126 GrStencilAttachment* sb = fContext->resourceProvider()->attachStencilAtt
achment(rt); |
127 if (sb) { | 127 if (sb) { |
128 if (!fNVPRTextContext) { | 128 if (!fNVPRTextContext) { |
129 fNVPRTextContext = GrStencilAndCoverTextContext::Create(fContext
); | 129 fNVPRTextContext = GrStencilAndCoverTextContext::Create(); |
130 } | 130 } |
131 | 131 |
132 return fNVPRTextContext; | 132 return fNVPRTextContext; |
133 } | 133 } |
134 } | 134 } |
135 | 135 |
136 if (!fAtlasTextContext) { | 136 if (!fAtlasTextContext) { |
137 fAtlasTextContext = GrAtlasTextContext::Create(fContext); | 137 fAtlasTextContext = GrAtlasTextContext::Create(); |
138 } | 138 } |
139 | 139 |
140 return fAtlasTextContext; | 140 return fAtlasTextContext; |
141 } | 141 } |
142 | 142 |
143 GrDrawTarget* GrDrawingManager::newDrawTarget(GrRenderTarget* rt) { | 143 GrDrawTarget* GrDrawingManager::newDrawTarget(GrRenderTarget* rt) { |
144 SkASSERT(fContext); | 144 SkASSERT(fContext); |
145 | 145 |
146 #ifndef ENABLE_MDB | 146 #ifndef ENABLE_MDB |
147 // When MDB is disabled we always just return the single drawTarget | 147 // When MDB is disabled we always just return the single drawTarget |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 | 192 |
193 GrDrawContext* GrDrawingManager::drawContext(GrRenderTarget* rt, | 193 GrDrawContext* GrDrawingManager::drawContext(GrRenderTarget* rt, |
194 const SkSurfaceProps* surfaceProps)
{ | 194 const SkSurfaceProps* surfaceProps)
{ |
195 if (this->abandoned()) { | 195 if (this->abandoned()) { |
196 return nullptr; | 196 return nullptr; |
197 } | 197 } |
198 | 198 |
199 return new GrDrawContext(fContext, this, rt, surfaceProps, fContext->getAudi
tTrail(), | 199 return new GrDrawContext(fContext, this, rt, surfaceProps, fContext->getAudi
tTrail(), |
200 fSingleOwner); | 200 fSingleOwner); |
201 } | 201 } |
OLD | NEW |