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 "GrAtlasTextContext.h" | 9 #include "GrAtlasTextContext.h" |
10 #include "GrDrawContext.h" | 10 #include "GrDrawContext.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 GrDrawContext* drawCo
ntext, | 25 GrDrawContext* drawCo
ntext, |
26 const SkDevicePropert
ies& properties) | 26 const SkDevicePropert
ies& properties) |
27 : GrTextContext(context, drawContext, properties) | 27 : GrTextContext(context, drawContext, properties) |
28 , fStroke(SkStrokeRec::kFill_InitStyle) | 28 , fStroke(SkStrokeRec::kFill_InitStyle) |
29 , fQueuedGlyphCount(0) | 29 , fQueuedGlyphCount(0) |
30 , fFallbackGlyphsIdx(kGlyphBufferSize) { | 30 , fFallbackGlyphsIdx(kGlyphBufferSize) { |
31 } | 31 } |
32 | 32 |
33 GrStencilAndCoverTextContext* | 33 GrStencilAndCoverTextContext* |
34 GrStencilAndCoverTextContext::Create(GrContext* context, GrDrawContext* drawCont
ext, | 34 GrStencilAndCoverTextContext::Create(GrContext* context, GrDrawContext* drawCont
ext, |
35 const SkDeviceProperties& props, bool fallb
ackUsesDFT) { | 35 const SkDeviceProperties& props) { |
36 GrStencilAndCoverTextContext* textContext = SkNEW_ARGS(GrStencilAndCoverText
Context, | 36 GrStencilAndCoverTextContext* textContext = SkNEW_ARGS(GrStencilAndCoverText
Context, |
37 (context, drawContext
, props)); | 37 (context, drawContext
, props)); |
38 textContext->fFallbackTextContext = GrAtlasTextContext::Create(context, draw
Context, | 38 textContext->fFallbackTextContext = GrAtlasTextContext::Create(context, draw
Context, props); |
39 props, fallba
ckUsesDFT); | |
40 | 39 |
41 return textContext; | 40 return textContext; |
42 } | 41 } |
43 | 42 |
44 GrStencilAndCoverTextContext::~GrStencilAndCoverTextContext() { | 43 GrStencilAndCoverTextContext::~GrStencilAndCoverTextContext() { |
45 } | 44 } |
46 | 45 |
47 bool GrStencilAndCoverTextContext::canDraw(const GrRenderTarget* rt, | 46 bool GrStencilAndCoverTextContext::canDraw(const GrRenderTarget* rt, |
48 const GrClip& clip, | 47 const GrClip& clip, |
49 const GrPaint& paint, | 48 const GrPaint& paint, |
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
481 fGlyphs = NULL; | 480 fGlyphs = NULL; |
482 | 481 |
483 SkGlyphCache::AttachCache(fGlyphCache); | 482 SkGlyphCache::AttachCache(fGlyphCache); |
484 fGlyphCache = NULL; | 483 fGlyphCache = NULL; |
485 | 484 |
486 fPipelineBuilder.stencil()->setDisabled(); | 485 fPipelineBuilder.stencil()->setDisabled(); |
487 fStateRestore.set(NULL); | 486 fStateRestore.set(NULL); |
488 fViewMatrix = fContextInitialMatrix; | 487 fViewMatrix = fContextInitialMatrix; |
489 } | 488 } |
490 | 489 |
OLD | NEW |