OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 "GrDistanceFieldTextContext.h" | 8 #include "GrDistanceFieldTextContext.h" |
9 #include "GrAtlas.h" | 9 #include "GrAtlas.h" |
10 #include "GrBitmapTextContext.h" | 10 #include "GrBitmapTextContext.h" |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 SkAutoTArray<uint8_t> data((int)size); | 181 SkAutoTArray<uint8_t> data((int)size); |
182 SkScalerContext::GetGammaLUTData(contrast, paintGamma, deviceGamma, data
.get()); | 182 SkScalerContext::GetGammaLUTData(contrast, paintGamma, deviceGamma, data
.get()); |
183 | 183 |
184 // TODO: Update this to use the cache rather than directly creating a te
xture. | 184 // TODO: Update this to use the cache rather than directly creating a te
xture. |
185 GrSurfaceDesc desc; | 185 GrSurfaceDesc desc; |
186 desc.fFlags = kNone_GrSurfaceFlags; | 186 desc.fFlags = kNone_GrSurfaceFlags; |
187 desc.fWidth = width; | 187 desc.fWidth = width; |
188 desc.fHeight = height; | 188 desc.fHeight = height; |
189 desc.fConfig = kAlpha_8_GrPixelConfig; | 189 desc.fConfig = kAlpha_8_GrPixelConfig; |
190 | 190 |
191 *gammaTexture = context->getGpu()->createTexture(desc, NULL, 0); | 191 *gammaTexture = context->getGpu()->createTexture(desc, true, NULL, 0); |
192 if (NULL == *gammaTexture) { | 192 if (NULL == *gammaTexture) { |
193 return; | 193 return; |
194 } | 194 } |
195 | 195 |
196 (*gammaTexture)->writePixels(0, 0, width, height, | 196 (*gammaTexture)->writePixels(0, 0, width, height, |
197 (*gammaTexture)->config(), data.get(), 0, | 197 (*gammaTexture)->config(), data.get(), 0, |
198 GrContext::kDontFlush_PixelOpsFlag); | 198 GrContext::kDontFlush_PixelOpsFlag); |
199 } | 199 } |
200 } | 200 } |
201 | 201 |
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
683 } | 683 } |
684 } | 684 } |
685 | 685 |
686 inline void GrDistanceFieldTextContext::finish() { | 686 inline void GrDistanceFieldTextContext::finish() { |
687 this->flush(); | 687 this->flush(); |
688 fTotalVertexCount = 0; | 688 fTotalVertexCount = 0; |
689 | 689 |
690 GrTextContext::finish(); | 690 GrTextContext::finish(); |
691 } | 691 } |
692 | 692 |
OLD | NEW |