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

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

Issue 14854005: Add geometry-based rotated AA rect drawing path (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Updated to ToT Created 7 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « src/gpu/GrContext.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 2011 Google Inc. 2 * Copyright 2011 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 "SkGpuDevice.h" 8 #include "SkGpuDevice.h"
9 9
10 #include "effects/GrTextureDomainEffect.h" 10 #include "effects/GrTextureDomainEffect.h"
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after
664 We have special code for hairline strokes, miter-strokes, and fills. 664 We have special code for hairline strokes, miter-strokes, and fills.
665 Anything else we just call our path code. 665 Anything else we just call our path code.
666 */ 666 */
667 bool usePath = doStroke && width > 0 && 667 bool usePath = doStroke && width > 0 &&
668 paint.getStrokeJoin() != SkPaint::kMiter_Join; 668 paint.getStrokeJoin() != SkPaint::kMiter_Join;
669 // another two reasons we might need to call drawPath... 669 // another two reasons we might need to call drawPath...
670 if (paint.getMaskFilter() || paint.getPathEffect()) { 670 if (paint.getMaskFilter() || paint.getPathEffect()) {
671 usePath = true; 671 usePath = true;
672 } 672 }
673 if (!usePath && paint.isAntiAlias() && !fContext->getMatrix().rectStaysRect( )) { 673 if (!usePath && paint.isAntiAlias() && !fContext->getMatrix().rectStaysRect( )) {
674 #ifdef SHADER_AA_FILL_RECT 674 #if defined(SHADER_AA_FILL_RECT) || !defined(IGNORE_ROT_AA_RECT_OPT)
675 if (doStroke) { 675 if (doStroke) {
676 #endif 676 #endif
677 usePath = true; 677 usePath = true;
678 #ifdef SHADER_AA_FILL_RECT 678 #if defined(SHADER_AA_FILL_RECT) || !defined(IGNORE_ROT_AA_RECT_OPT)
679 } else { 679 } else {
680 usePath = !fContext->getMatrix().preservesRightAngles(); 680 usePath = !fContext->getMatrix().preservesRightAngles();
681 } 681 }
682 #endif 682 #endif
683 } 683 }
684 // small miter limit means right angles show bevel... 684 // small miter limit means right angles show bevel...
685 if (SkPaint::kMiter_Join == paint.getStrokeJoin() && 685 if (SkPaint::kMiter_Join == paint.getStrokeJoin() &&
686 paint.getStrokeMiter() < SK_ScalarSqrt2) 686 paint.getStrokeMiter() < SK_ScalarSqrt2)
687 { 687 {
688 usePath = true; 688 usePath = true;
(...skipping 1169 matching lines...) Expand 10 before | Expand all | Expand 10 after
1858 GrTexture* texture, 1858 GrTexture* texture,
1859 bool needClear) 1859 bool needClear)
1860 : SkDevice(make_bitmap(context, texture->asRenderTarget())) { 1860 : SkDevice(make_bitmap(context, texture->asRenderTarget())) {
1861 1861
1862 GrAssert(texture && texture->asRenderTarget()); 1862 GrAssert(texture && texture->asRenderTarget());
1863 // This constructor is called from onCreateCompatibleDevice. It has locked t he RT in the texture 1863 // This constructor is called from onCreateCompatibleDevice. It has locked t he RT in the texture
1864 // cache. We pass true for the third argument so that it will get unlocked. 1864 // cache. We pass true for the third argument so that it will get unlocked.
1865 this->initFromRenderTarget(context, texture->asRenderTarget(), true); 1865 this->initFromRenderTarget(context, texture->asRenderTarget(), true);
1866 fNeedClear = needClear; 1866 fNeedClear = needClear;
1867 } 1867 }
OLDNEW
« no previous file with comments | « src/gpu/GrContext.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698