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

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

Issue 1001503002: Implement support for mixed sampled render targets (Closed) Base URL: https://skia.googlesource.com/skia.git@mix1
Patch Set: PipelineStage enum relocation Created 5 years, 9 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 "GrBitmapTextContext.h" 9 #include "GrBitmapTextContext.h"
10 #include "GrDrawTarget.h" 10 #include "GrDrawTarget.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 return false; 55 return false;
56 } 56 }
57 57
58 // No hairlines unless we can map the 1 px width to the object space. 58 // No hairlines unless we can map the 1 px width to the object space.
59 if (skPaint.getStyle() == SkPaint::kStroke_Style 59 if (skPaint.getStyle() == SkPaint::kStroke_Style
60 && skPaint.getStrokeWidth() == 0 60 && skPaint.getStrokeWidth() == 0
61 && viewMatrix.hasPerspective()) { 61 && viewMatrix.hasPerspective()) {
62 return false; 62 return false;
63 } 63 }
64 64
65 if (skPaint.isAntiAlias() &&
66 kStencil_GrSampleConfig == rt->sampleConfig() &&
67 !paint.getXPFactory()->canTweakAlphaForCoverage()) {
68 return false;
69 }
70
65 // No color bitmap fonts. 71 // No color bitmap fonts.
66 SkScalerContext::Rec rec; 72 SkScalerContext::Rec rec;
67 SkScalerContext::MakeRec(skPaint, &fDeviceProperties, NULL, &rec); 73 SkScalerContext::MakeRec(skPaint, &fDeviceProperties, NULL, &rec);
68 return rec.getFormat() != SkMask::kARGB32_Format; 74 return rec.getFormat() != SkMask::kARGB32_Format;
69 } 75 }
70 76
71 void GrStencilAndCoverTextContext::onDrawText(GrRenderTarget* rt, 77 void GrStencilAndCoverTextContext::onDrawText(GrRenderTarget* rt,
72 const GrClip& clip, 78 const GrClip& clip,
73 const GrPaint& paint, 79 const GrPaint& paint,
74 const SkPaint& skPaint, 80 const SkPaint& skPaint,
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 360
355 fGlyphCache = fSkPaint.detachCache(&fDeviceProperties, NULL, true /*igno reGamma*/); 361 fGlyphCache = fSkPaint.detachCache(&fDeviceProperties, NULL, true /*igno reGamma*/);
356 fGlyphs = canUseRawPaths ? 362 fGlyphs = canUseRawPaths ?
357 get_gr_glyphs(fContext, fSkPaint.getTypeface(), NULL, fStr oke) : 363 get_gr_glyphs(fContext, fSkPaint.getTypeface(), NULL, fStr oke) :
358 get_gr_glyphs(fContext, fGlyphCache->getScalerContext()->g etTypeface(), 364 get_gr_glyphs(fContext, fGlyphCache->getScalerContext()->g etTypeface(),
359 &fGlyphCache->getDescriptor(), fStroke); 365 &fGlyphCache->getDescriptor(), fStroke);
360 } 366 }
361 367
362 fStateRestore.set(&fPipelineBuilder); 368 fStateRestore.set(&fPipelineBuilder);
363 369
364 fPipelineBuilder.setFromPaint(fPaint, fRenderTarget, fClip); 370 fPipelineBuilder.setFromPaint(fPaint, fRenderTarget, fClip,
371 GrRenderTarget::kStencilBuffer_PipelineStage);
365 372
366 GR_STATIC_CONST_SAME_STENCIL(kStencilPass, 373 GR_STATIC_CONST_SAME_STENCIL(kStencilPass,
367 kZero_StencilOp, 374 kZero_StencilOp,
368 kZero_StencilOp, 375 kZero_StencilOp,
369 kNotEqual_StencilFunc, 376 kNotEqual_StencilFunc,
370 0xffff, 377 0xffff,
371 0x0000, 378 0x0000,
372 0xffff); 379 0xffff);
373 380
374 *fPipelineBuilder.stencil() = kStencilPass; 381 *fPipelineBuilder.stencil() = kStencilPass;
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 474
468 SkGlyphCache::AttachCache(fGlyphCache); 475 SkGlyphCache::AttachCache(fGlyphCache);
469 fGlyphCache = NULL; 476 fGlyphCache = NULL;
470 477
471 fPipelineBuilder.stencil()->setDisabled(); 478 fPipelineBuilder.stencil()->setDisabled();
472 fStateRestore.set(NULL); 479 fStateRestore.set(NULL);
473 fViewMatrix = fContextInitialMatrix; 480 fViewMatrix = fContextInitialMatrix;
474 GrTextContext::finish(); 481 GrTextContext::finish();
475 } 482 }
476 483
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698