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

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

Issue 1375153007: Dynamically allocate the GrDrawContexts (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix more bugs Created 5 years, 2 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
« include/gpu/GrContext.h ('K') | « src/gpu/GrDrawContext.cpp ('k') | no next file » | 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 2010 Google Inc. 2 * Copyright 2010 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 "GrTextContext.h" 8 #include "GrTextContext.h"
9 #include "GrBlurUtils.h" 9 #include "GrBlurUtils.h"
10 #include "GrContext.h" 10 #include "GrContext.h"
11 #include "GrDrawContext.h" 11 #include "GrDrawContext.h"
12 #include "GrFontScaler.h" 12 #include "GrFontScaler.h"
13 13
14 #include "SkAutoKern.h" 14 #include "SkAutoKern.h"
15 #include "SkDrawFilter.h" 15 #include "SkDrawFilter.h"
16 #include "SkDrawProcs.h" 16 #include "SkDrawProcs.h"
17 #include "SkGlyphCache.h" 17 #include "SkGlyphCache.h"
18 #include "SkGpuDevice.h" 18 #include "SkGpuDevice.h"
19 #include "SkGrPriv.h" 19 #include "SkGrPriv.h"
20 #include "SkTextBlob.h" 20 #include "SkTextBlob.h"
21 #include "SkTextMapStateProc.h" 21 #include "SkTextMapStateProc.h"
22 #include "SkTextToPathIter.h" 22 #include "SkTextToPathIter.h"
23 23
24 GrTextContext::GrTextContext(GrContext* context, const SkSurfaceProps& surfacePr ops) 24 GrTextContext::GrTextContext(GrContext* context, const SkSurfaceProps& surfacePr ops)
25 : fFallbackTextContext(nullptr) 25 : fFallbackTextContext(nullptr)
26 , fContext(context) 26 , fContext(context)
27 , fSurfaceProps(surfaceProps) { 27 , fSurfaceProps(surfaceProps) {
28 } 28 }
29 29
30 GrTextContext::~GrTextContext() { delete fFallbackTextContext; } 30 GrTextContext::~GrTextContext() {
31 delete fFallbackTextContext;
32 }
31 33
32 void GrTextContext::drawText(GrDrawContext* dc, GrRenderTarget* rt, 34 void GrTextContext::drawText(GrDrawContext* dc, GrRenderTarget* rt,
33 const GrClip& clip, const GrPaint& paint, 35 const GrClip& clip, const GrPaint& paint,
34 const SkPaint& skPaint, const SkMatrix& viewMatrix, 36 const SkPaint& skPaint, const SkMatrix& viewMatrix,
35 const char text[], size_t byteLength, 37 const char text[], size_t byteLength,
36 SkScalar x, SkScalar y, const SkIRect& clipBounds) { 38 SkScalar x, SkScalar y, const SkIRect& clipBounds) {
37 if (fContext->abandoned()) { 39 if (fContext->abandoned()) {
38 return; 40 return;
39 } 41 }
40 42
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 if (cache->getAuxProcData(GlyphCacheAuxProc, &auxData)) { 272 if (cache->getAuxProcData(GlyphCacheAuxProc, &auxData)) {
271 scaler = (GrFontScaler*)auxData; 273 scaler = (GrFontScaler*)auxData;
272 } 274 }
273 if (nullptr == scaler) { 275 if (nullptr == scaler) {
274 scaler = new GrFontScaler(cache); 276 scaler = new GrFontScaler(cache);
275 cache->setAuxProc(GlyphCacheAuxProc, scaler); 277 cache->setAuxProc(GlyphCacheAuxProc, scaler);
276 } 278 }
277 279
278 return scaler; 280 return scaler;
279 } 281 }
OLDNEW
« include/gpu/GrContext.h ('K') | « src/gpu/GrDrawContext.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698