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

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

Issue 1151283004: Split drawing functionality out of GrContext and into new GrDrawContext (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix no-GPU builds Created 5 years, 6 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/GrStencilAndCoverPathRenderer.cpp ('k') | src/gpu/GrTest.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 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 "GrDrawTarget.h" 11 #include "GrDrawTarget.h"
11 #include "GrPath.h" 12 #include "GrPath.h"
12 #include "GrPathRange.h" 13 #include "GrPathRange.h"
13 #include "GrResourceProvider.h" 14 #include "GrResourceProvider.h"
14 #include "SkAutoKern.h" 15 #include "SkAutoKern.h"
15 #include "SkDraw.h" 16 #include "SkDraw.h"
16 #include "SkDrawProcs.h" 17 #include "SkDrawProcs.h"
17 #include "SkGlyphCache.h" 18 #include "SkGlyphCache.h"
18 #include "SkGpuDevice.h" 19 #include "SkGpuDevice.h"
19 #include "SkPath.h" 20 #include "SkPath.h"
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 GR_STATIC_ASSERT(0 == offsetof(SkPoint, fX)); 428 GR_STATIC_ASSERT(0 == offsetof(SkPoint, fX));
428 429
429 return &pointArray[0].fX; 430 return &pointArray[0].fX;
430 } 431 }
431 432
432 void GrStencilAndCoverTextContext::flush() { 433 void GrStencilAndCoverTextContext::flush() {
433 if (fQueuedGlyphCount > 0) { 434 if (fQueuedGlyphCount > 0) {
434 SkAutoTUnref<GrPathProcessor> pp(GrPathProcessor::Create(fPaint.getColor (), 435 SkAutoTUnref<GrPathProcessor> pp(GrPathProcessor::Create(fPaint.getColor (),
435 fViewMatrix, 436 fViewMatrix,
436 fLocalMatrix)); 437 fLocalMatrix));
437 fDrawTarget->drawPaths(&fPipelineBuilder, pp, fGlyphs, 438
439 GrDrawContext* drawContext = fContext->drawContext();
440 if (!drawContext) {
441 return;
442 }
443
444 drawContext->drawPaths(&fPipelineBuilder, pp, fGlyphs,
438 fGlyphIndices, GrPathRange::kU16_PathIndexType, 445 fGlyphIndices, GrPathRange::kU16_PathIndexType,
439 get_xy_scalar_array(fGlyphPositions), 446 get_xy_scalar_array(fGlyphPositions),
440 GrPathRendering::kTranslate_PathTransformType, 447 GrPathRendering::kTranslate_PathTransformType,
441 fQueuedGlyphCount, GrPathRendering::kWinding_Fill Type); 448 fQueuedGlyphCount, GrPathRendering::kWinding_Fill Type);
442 449
443 fQueuedGlyphCount = 0; 450 fQueuedGlyphCount = 0;
444 } 451 }
445 452
446 if (fFallbackGlyphsIdx < kGlyphBufferSize) { 453 if (fFallbackGlyphsIdx < kGlyphBufferSize) {
447 int fallbackGlyphCount = kGlyphBufferSize - fFallbackGlyphsIdx; 454 int fallbackGlyphCount = kGlyphBufferSize - fFallbackGlyphsIdx;
(...skipping 27 matching lines...) Expand all
475 482
476 fGlyphs->unref(); 483 fGlyphs->unref();
477 fGlyphs = NULL; 484 fGlyphs = NULL;
478 485
479 SkGlyphCache::AttachCache(fGlyphCache); 486 SkGlyphCache::AttachCache(fGlyphCache);
480 fGlyphCache = NULL; 487 fGlyphCache = NULL;
481 488
482 fPipelineBuilder.stencil()->setDisabled(); 489 fPipelineBuilder.stencil()->setDisabled();
483 fStateRestore.set(NULL); 490 fStateRestore.set(NULL);
484 fViewMatrix = fContextInitialMatrix; 491 fViewMatrix = fContextInitialMatrix;
485 GrTextContext::finish();
486 } 492 }
487 493
OLDNEW
« no previous file with comments | « src/gpu/GrStencilAndCoverPathRenderer.cpp ('k') | src/gpu/GrTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698