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

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

Issue 1288923005: Use stencil ops that don't issue writes whenever possible (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 4 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
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 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 fLocalMatrix)); 428 fLocalMatrix));
429 429
430 // We should only be flushing about once every run. However, if this im pacts performance 430 // We should only be flushing about once every run. However, if this im pacts performance
431 // we could move the creation of the GrPipelineBuilder earlier. 431 // we could move the creation of the GrPipelineBuilder earlier.
432 GrPipelineBuilder pipelineBuilder(fPaint, fRenderTarget, fClip); 432 GrPipelineBuilder pipelineBuilder(fPaint, fRenderTarget, fClip);
433 SkASSERT(fRenderTarget->isStencilBufferMultisampled() || !fPaint.isAntiA lias()); 433 SkASSERT(fRenderTarget->isStencilBufferMultisampled() || !fPaint.isAntiA lias());
434 pipelineBuilder.setState(GrPipelineBuilder::kHWAntialias_Flag, fPaint.is AntiAlias()); 434 pipelineBuilder.setState(GrPipelineBuilder::kHWAntialias_Flag, fPaint.is AntiAlias());
435 435
436 GR_STATIC_CONST_SAME_STENCIL(kStencilPass, 436 GR_STATIC_CONST_SAME_STENCIL(kStencilPass,
437 kZero_StencilOp, 437 kZero_StencilOp,
438 kZero_StencilOp, 438 kKeep_StencilOp,
439 kNotEqual_StencilFunc, 439 kNotEqual_StencilFunc,
440 0xffff, 440 0xffff,
441 0x0000, 441 0x0000,
442 0xffff); 442 0xffff);
443 443
444 *pipelineBuilder.stencil() = kStencilPass; 444 *pipelineBuilder.stencil() = kStencilPass;
445 445
446 SkASSERT(0 == fQueuedGlyphCount); 446 SkASSERT(0 == fQueuedGlyphCount);
447 SkASSERT(kGlyphBufferSize == fFallbackGlyphsIdx); 447 SkASSERT(kGlyphBufferSize == fFallbackGlyphsIdx);
448 448
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 487
488 fGlyphs->unref(); 488 fGlyphs->unref();
489 fGlyphs = NULL; 489 fGlyphs = NULL;
490 490
491 SkGlyphCache::AttachCache(fGlyphCache); 491 SkGlyphCache::AttachCache(fGlyphCache);
492 fGlyphCache = NULL; 492 fGlyphCache = NULL;
493 493
494 fViewMatrix = fContextInitialMatrix; 494 fViewMatrix = fContextInitialMatrix;
495 } 495 }
496 496
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698