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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 | 67 |
68 fVertexBounds.setLargestInverted(); | 68 fVertexBounds.setLargestInverted(); |
69 } | 69 } |
70 | 70 |
71 GrDistanceFieldTextContext* GrDistanceFieldTextContext::Create(GrContext* contex
t, | 71 GrDistanceFieldTextContext* GrDistanceFieldTextContext::Create(GrContext* contex
t, |
72 SkGpuDevice* gpuD
evice, | 72 SkGpuDevice* gpuD
evice, |
73 const SkDevicePro
perties& props, | 73 const SkDevicePro
perties& props, |
74 bool enable) { | 74 bool enable) { |
75 GrDistanceFieldTextContext* textContext = SkNEW_ARGS(GrDistanceFieldTextCont
ext, | 75 GrDistanceFieldTextContext* textContext = SkNEW_ARGS(GrDistanceFieldTextCont
ext, |
76 (context, gpuDevice, pr
ops, enable)); | 76 (context, gpuDevice, pr
ops, enable)); |
| 77 #ifdef USE_BITMAP_TEXTBLOBS |
| 78 textContext->fFallbackTextContext = GrBitmapTextContextB::Create(context, gp
uDevice, props); |
| 79 #else |
77 textContext->fFallbackTextContext = GrBitmapTextContext::Create(context, gpu
Device, props); | 80 textContext->fFallbackTextContext = GrBitmapTextContext::Create(context, gpu
Device, props); |
| 81 #endif |
78 | 82 |
79 return textContext; | 83 return textContext; |
80 } | 84 } |
81 | 85 |
82 GrDistanceFieldTextContext::~GrDistanceFieldTextContext() { | 86 GrDistanceFieldTextContext::~GrDistanceFieldTextContext() { |
83 SkSafeSetNull(fGammaTexture); | 87 SkSafeSetNull(fGammaTexture); |
84 } | 88 } |
85 | 89 |
86 bool GrDistanceFieldTextContext::canDraw(const GrRenderTarget* rt, | 90 bool GrDistanceFieldTextContext::canDraw(const GrRenderTarget* rt, |
87 const GrClip& clip, | 91 const GrClip& clip, |
(...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
732 } | 736 } |
733 } | 737 } |
734 | 738 |
735 inline void GrDistanceFieldTextContext::finish() { | 739 inline void GrDistanceFieldTextContext::finish() { |
736 this->flush(); | 740 this->flush(); |
737 fTotalVertexCount = 0; | 741 fTotalVertexCount = 0; |
738 | 742 |
739 GrTextContext::finish(); | 743 GrTextContext::finish(); |
740 } | 744 } |
741 | 745 |
OLD | NEW |