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 | |
80 textContext->fFallbackTextContext = GrBitmapTextContext::Create(context, gpu
Device, props); | 77 textContext->fFallbackTextContext = GrBitmapTextContext::Create(context, gpu
Device, props); |
81 #endif | |
82 | 78 |
83 return textContext; | 79 return textContext; |
84 } | 80 } |
85 | 81 |
86 GrDistanceFieldTextContext::~GrDistanceFieldTextContext() { | 82 GrDistanceFieldTextContext::~GrDistanceFieldTextContext() { |
87 SkSafeSetNull(fGammaTexture); | 83 SkSafeSetNull(fGammaTexture); |
88 } | 84 } |
89 | 85 |
90 bool GrDistanceFieldTextContext::canDraw(const GrRenderTarget* rt, | 86 bool GrDistanceFieldTextContext::canDraw(const GrRenderTarget* rt, |
91 const GrClip& clip, | 87 const GrClip& clip, |
(...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
736 } | 732 } |
737 } | 733 } |
738 | 734 |
739 inline void GrDistanceFieldTextContext::finish() { | 735 inline void GrDistanceFieldTextContext::finish() { |
740 this->flush(); | 736 this->flush(); |
741 fTotalVertexCount = 0; | 737 fTotalVertexCount = 0; |
742 | 738 |
743 GrTextContext::finish(); | 739 GrTextContext::finish(); |
744 } | 740 } |
745 | 741 |
OLD | NEW |