| 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 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 SkScalar paintGamma = deviceProperties.gamma(); | 187 SkScalar paintGamma = deviceProperties.gamma(); |
| 188 SkScalar deviceGamma = deviceProperties.gamma(); | 188 SkScalar deviceGamma = deviceProperties.gamma(); |
| 189 | 189 |
| 190 size = SkScalerContext::GetGammaLUTSize(contrast, paintGamma, deviceGamm
a, | 190 size = SkScalerContext::GetGammaLUTSize(contrast, paintGamma, deviceGamm
a, |
| 191 &width, &height); | 191 &width, &height); |
| 192 | 192 |
| 193 SkAutoTArray<uint8_t> data((int)size); | 193 SkAutoTArray<uint8_t> data((int)size); |
| 194 SkScalerContext::GetGammaLUTData(contrast, paintGamma, deviceGamma, data
.get()); | 194 SkScalerContext::GetGammaLUTData(contrast, paintGamma, deviceGamma, data
.get()); |
| 195 | 195 |
| 196 // TODO: Update this to use the cache rather than directly creating a te
xture. | 196 // TODO: Update this to use the cache rather than directly creating a te
xture. |
| 197 GrTextureDesc desc; | 197 GrSurfaceDesc desc; |
| 198 desc.fFlags = kDynamicUpdate_GrTextureFlagBit; | 198 desc.fFlags = kNone_GrSurfaceFlags; |
| 199 desc.fWidth = width; | 199 desc.fWidth = width; |
| 200 desc.fHeight = height; | 200 desc.fHeight = height; |
| 201 desc.fConfig = kAlpha_8_GrPixelConfig; | 201 desc.fConfig = kAlpha_8_GrPixelConfig; |
| 202 | 202 |
| 203 *gammaTexture = context->getGpu()->createTexture(desc, NULL, 0); | 203 *gammaTexture = context->getGpu()->createTexture(desc, NULL, 0); |
| 204 if (NULL == *gammaTexture) { | 204 if (NULL == *gammaTexture) { |
| 205 return; | 205 return; |
| 206 } | 206 } |
| 207 | 207 |
| 208 (*gammaTexture)->writePixels(0, 0, width, height, | 208 (*gammaTexture)->writePixels(0, 0, width, height, |
| (...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 697 } | 697 } |
| 698 } | 698 } |
| 699 | 699 |
| 700 inline void GrDistanceFieldTextContext::finish() { | 700 inline void GrDistanceFieldTextContext::finish() { |
| 701 this->flush(); | 701 this->flush(); |
| 702 fTotalVertexCount = 0; | 702 fTotalVertexCount = 0; |
| 703 | 703 |
| 704 GrTextContext::finish(); | 704 GrTextContext::finish(); |
| 705 } | 705 } |
| 706 | 706 |
| OLD | NEW |