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 | |
40 textContext->fFallbackTextContext = GrBitmapTextContext::Create(context, gpu
Device, props); | 37 textContext->fFallbackTextContext = GrBitmapTextContext::Create(context, gpu
Device, props); |
41 #endif | |
42 | 38 |
43 return textContext; | 39 return textContext; |
44 } | 40 } |
45 | 41 |
46 GrStencilAndCoverTextContext::~GrStencilAndCoverTextContext() { | 42 GrStencilAndCoverTextContext::~GrStencilAndCoverTextContext() { |
47 } | 43 } |
48 | 44 |
49 bool GrStencilAndCoverTextContext::canDraw(const GrRenderTarget* rt, | 45 bool GrStencilAndCoverTextContext::canDraw(const GrRenderTarget* rt, |
50 const GrClip& clip, | 46 const GrClip& clip, |
51 const GrPaint& paint, | 47 const GrPaint& paint, |
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
478 | 474 |
479 SkGlyphCache::AttachCache(fGlyphCache); | 475 SkGlyphCache::AttachCache(fGlyphCache); |
480 fGlyphCache = NULL; | 476 fGlyphCache = NULL; |
481 | 477 |
482 fPipelineBuilder.stencil()->setDisabled(); | 478 fPipelineBuilder.stencil()->setDisabled(); |
483 fStateRestore.set(NULL); | 479 fStateRestore.set(NULL); |
484 fViewMatrix = fContextInitialMatrix; | 480 fViewMatrix = fContextInitialMatrix; |
485 GrTextContext::finish(); | 481 GrTextContext::finish(); |
486 } | 482 } |
487 | 483 |
OLD | NEW |