Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1132)

Side by Side Diff: src/gpu/GrDistanceFieldTextContext.cpp

Issue 1082843002: Initial CL to add distance field support to GrAtlasTextContext (Closed) Base URL: https://skia.googlesource.com/skia.git@attryst2
Patch Set: windows warnigns Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/gpu/GrContext.cpp ('k') | src/gpu/GrStencilAndCoverTextContext.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "GrAtlasTextContext.h" 10 #include "GrAtlasTextContext.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 } 75 }
76 76
77 GrDistanceFieldTextContext* GrDistanceFieldTextContext::Create(GrContext* contex t, 77 GrDistanceFieldTextContext* GrDistanceFieldTextContext::Create(GrContext* contex t,
78 SkGpuDevice* gpuD evice, 78 SkGpuDevice* gpuD evice,
79 const SkDevicePro perties& props, 79 const SkDevicePro perties& props,
80 bool enable) { 80 bool enable) {
81 GrDistanceFieldTextContext* textContext = SkNEW_ARGS(GrDistanceFieldTextCont ext, 81 GrDistanceFieldTextContext* textContext = SkNEW_ARGS(GrDistanceFieldTextCont ext,
82 (context, gpuDevice, pr ops, enable)); 82 (context, gpuDevice, pr ops, enable));
83 textContext->buildDistanceAdjustTable(); 83 textContext->buildDistanceAdjustTable();
84 #ifdef USE_BITMAP_TEXTBLOBS 84 #ifdef USE_BITMAP_TEXTBLOBS
85 textContext->fFallbackTextContext = GrAtlasTextContext::Create(context, gpuD evice, props); 85 textContext->fFallbackTextContext = GrAtlasTextContext::Create(context, gpuD evice, props,
86 enable);
86 #else 87 #else
87 textContext->fFallbackTextContext = GrBitmapTextContext::Create(context, gpu Device, props); 88 textContext->fFallbackTextContext = GrBitmapTextContext::Create(context, gpu Device, props);
88 #endif 89 #endif
89 90
90 return textContext; 91 return textContext;
91 } 92 }
92 93
93 void GrDistanceFieldTextContext::buildDistanceAdjustTable() { 94 void GrDistanceFieldTextContext::buildDistanceAdjustTable() {
94 95
95 // This is used for an approximation of the mask gamma hack, used by raster and bitmap 96 // This is used for an approximation of the mask gamma hack, used by raster and bitmap
(...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after
794 } 795 }
795 } 796 }
796 797
797 inline void GrDistanceFieldTextContext::finish() { 798 inline void GrDistanceFieldTextContext::finish() {
798 this->flush(); 799 this->flush();
799 fTotalVertexCount = 0; 800 fTotalVertexCount = 0;
800 801
801 GrTextContext::finish(); 802 GrTextContext::finish();
802 } 803 }
803 804
OLDNEW
« no previous file with comments | « src/gpu/GrContext.cpp ('k') | src/gpu/GrStencilAndCoverTextContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698