OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 "GrStencilAndCoverTextContext.h" | 8 #include "GrStencilAndCoverTextContext.h" |
9 #include "GrBitmapTextContext.h" | 9 #include "GrBitmapTextContext.h" |
10 #include "GrDrawTarget.h" | 10 #include "GrDrawTarget.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 , fStroke(SkStrokeRec::kFill_InitStyle) | 27 , fStroke(SkStrokeRec::kFill_InitStyle) |
28 , fQueuedGlyphCount(0) | 28 , fQueuedGlyphCount(0) |
29 , fFallbackGlyphsIdx(kGlyphBufferSize) { | 29 , fFallbackGlyphsIdx(kGlyphBufferSize) { |
30 } | 30 } |
31 | 31 |
32 GrStencilAndCoverTextContext* | 32 GrStencilAndCoverTextContext* |
33 GrStencilAndCoverTextContext::Create(GrContext* context, SkGpuDevice* gpuDevice, | 33 GrStencilAndCoverTextContext::Create(GrContext* context, SkGpuDevice* gpuDevice, |
34 const SkDeviceProperties& props) { | 34 const SkDeviceProperties& props) { |
35 GrStencilAndCoverTextContext* textContext = SkNEW_ARGS(GrStencilAndCoverText
Context, | 35 GrStencilAndCoverTextContext* textContext = SkNEW_ARGS(GrStencilAndCoverText
Context, |
36 (context, gpuDevice,
props)); | 36 (context, gpuDevice,
props)); |
| 37 #ifdef USE_BITMAP_TEXTBLOBS |
| 38 textContext->fFallbackTextContext = GrBitmapTextContextB::Create(context, gp
uDevice, props); |
| 39 #else |
37 textContext->fFallbackTextContext = GrBitmapTextContext::Create(context, gpu
Device, props); | 40 textContext->fFallbackTextContext = GrBitmapTextContext::Create(context, gpu
Device, props); |
| 41 #endif |
38 | 42 |
39 return textContext; | 43 return textContext; |
40 } | 44 } |
41 | 45 |
42 GrStencilAndCoverTextContext::~GrStencilAndCoverTextContext() { | 46 GrStencilAndCoverTextContext::~GrStencilAndCoverTextContext() { |
43 } | 47 } |
44 | 48 |
45 bool GrStencilAndCoverTextContext::canDraw(const GrRenderTarget* rt, | 49 bool GrStencilAndCoverTextContext::canDraw(const GrRenderTarget* rt, |
46 const GrClip& clip, | 50 const GrClip& clip, |
47 const GrPaint& paint, | 51 const GrPaint& paint, |
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
474 | 478 |
475 SkGlyphCache::AttachCache(fGlyphCache); | 479 SkGlyphCache::AttachCache(fGlyphCache); |
476 fGlyphCache = NULL; | 480 fGlyphCache = NULL; |
477 | 481 |
478 fPipelineBuilder.stencil()->setDisabled(); | 482 fPipelineBuilder.stencil()->setDisabled(); |
479 fStateRestore.set(NULL); | 483 fStateRestore.set(NULL); |
480 fViewMatrix = fContextInitialMatrix; | 484 fViewMatrix = fContextInitialMatrix; |
481 GrTextContext::finish(); | 485 GrTextContext::finish(); |
482 } | 486 } |
483 | 487 |
OLD | NEW |