| 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 "GrAtlasTextContext.h" | 10 #include "GrAtlasTextContext.h" |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 } | 75 } |
| 76 | 76 |
| 77 GrDistanceFieldTextContext* GrDistanceFieldTextContext::Create(GrContext* contex
t, | 77 GrDistanceFieldTextContext* GrDistanceFieldTextContext::Create(GrContext* contex
t, |
| 78 SkGpuDevice* gpuD
evice, | 78 SkGpuDevice* gpuD
evice, |
| 79 const SkDevicePro
perties& props, | 79 const SkDevicePro
perties& props, |
| 80 bool enable) { | 80 bool enable) { |
| 81 GrDistanceFieldTextContext* textContext = SkNEW_ARGS(GrDistanceFieldTextCont
ext, | 81 GrDistanceFieldTextContext* textContext = SkNEW_ARGS(GrDistanceFieldTextCont
ext, |
| 82 (context, gpuDevice, pr
ops, enable)); | 82 (context, gpuDevice, pr
ops, enable)); |
| 83 textContext->buildDistanceAdjustTable(); | 83 textContext->buildDistanceAdjustTable(); |
| 84 #ifdef USE_BITMAP_TEXTBLOBS | 84 #ifdef USE_BITMAP_TEXTBLOBS |
| 85 textContext->fFallbackTextContext = GrAtlasTextContext::Create(context, gpuD
evice, props); | 85 textContext->fFallbackTextContext = GrAtlasTextContext::Create(context, gpuD
evice, props, |
| 86 enable); |
| 86 #else | 87 #else |
| 87 textContext->fFallbackTextContext = GrBitmapTextContext::Create(context, gpu
Device, props); | 88 textContext->fFallbackTextContext = GrBitmapTextContext::Create(context, gpu
Device, props); |
| 88 #endif | 89 #endif |
| 89 | 90 |
| 90 return textContext; | 91 return textContext; |
| 91 } | 92 } |
| 92 | 93 |
| 93 void GrDistanceFieldTextContext::buildDistanceAdjustTable() { | 94 void GrDistanceFieldTextContext::buildDistanceAdjustTable() { |
| 94 | 95 |
| 95 // This is used for an approximation of the mask gamma hack, used by raster
and bitmap | 96 // This is used for an approximation of the mask gamma hack, used by raster
and bitmap |
| (...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 794 } | 795 } |
| 795 } | 796 } |
| 796 | 797 |
| 797 inline void GrDistanceFieldTextContext::finish() { | 798 inline void GrDistanceFieldTextContext::finish() { |
| 798 this->flush(); | 799 this->flush(); |
| 799 fTotalVertexCount = 0; | 800 fTotalVertexCount = 0; |
| 800 | 801 |
| 801 GrTextContext::finish(); | 802 GrTextContext::finish(); |
| 802 } | 803 } |
| 803 | 804 |
| OLD | NEW |