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

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

Issue 1231923002: Remove init function from GrTextContext.h (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 5 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/GrStencilAndCoverTextContext.h ('k') | src/gpu/GrTextContext.h » ('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 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 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 } 248 }
249 249
250 void GrStencilAndCoverTextContext::init(GrRenderTarget* rt, 250 void GrStencilAndCoverTextContext::init(GrRenderTarget* rt,
251 const GrClip& clip, 251 const GrClip& clip,
252 const GrPaint& paint, 252 const GrPaint& paint,
253 const SkPaint& skPaint, 253 const SkPaint& skPaint,
254 size_t textByteLength, 254 size_t textByteLength,
255 RenderMode renderMode, 255 RenderMode renderMode,
256 const SkMatrix& viewMatrix, 256 const SkMatrix& viewMatrix,
257 const SkIRect& regionClipBounds) { 257 const SkIRect& regionClipBounds) {
258 GrTextContext::init(rt, clip, paint, skPaint, regionClipBounds); 258 fClip = clip;
259
260 fRenderTarget.reset(SkRef(rt));
261
262 fRegionClipBounds = regionClipBounds;
263 fClip.getConservativeBounds(fRenderTarget->width(), fRenderTarget->height(), &fClipRect);
264
265 fPaint = paint;
266 fSkPaint = skPaint;
259 267
260 fContextInitialMatrix = viewMatrix; 268 fContextInitialMatrix = viewMatrix;
261 fViewMatrix = viewMatrix; 269 fViewMatrix = viewMatrix;
262 fLocalMatrix = SkMatrix::I(); 270 fLocalMatrix = SkMatrix::I();
263 271
264 const bool otherBackendsWillDrawAsPaths = 272 const bool otherBackendsWillDrawAsPaths =
265 SkDraw::ShouldDrawTextAsPaths(skPaint, fContextInitialMatrix); 273 SkDraw::ShouldDrawTextAsPaths(skPaint, fContextInitialMatrix);
266 274
267 fUsingDeviceSpaceGlyphs = !otherBackendsWillDrawAsPaths && 275 fUsingDeviceSpaceGlyphs = !otherBackendsWillDrawAsPaths &&
268 kMaxAccuracy_RenderMode == renderMode && 276 kMaxAccuracy_RenderMode == renderMode &&
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
480 fGlyphs = NULL; 488 fGlyphs = NULL;
481 489
482 SkGlyphCache::AttachCache(fGlyphCache); 490 SkGlyphCache::AttachCache(fGlyphCache);
483 fGlyphCache = NULL; 491 fGlyphCache = NULL;
484 492
485 fPipelineBuilder.stencil()->setDisabled(); 493 fPipelineBuilder.stencil()->setDisabled();
486 fStateRestore.set(NULL); 494 fStateRestore.set(NULL);
487 fViewMatrix = fContextInitialMatrix; 495 fViewMatrix = fContextInitialMatrix;
488 } 496 }
489 497
OLDNEW
« no previous file with comments | « src/gpu/GrStencilAndCoverTextContext.h ('k') | src/gpu/GrTextContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698