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

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

Issue 13521006: First pass at Rect Effect (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: renamed isOrthogonal to preservesRightAngles Created 7 years, 8 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 /* 664 /*
665 We have special code for hairline strokes, miter-strokes, and fills. 665 We have special code for hairline strokes, miter-strokes, and fills.
666 Anything else we just call our path code. 666 Anything else we just call our path code.
667 */ 667 */
668 bool usePath = doStroke && width > 0 && 668 bool usePath = doStroke && width > 0 &&
669 paint.getStrokeJoin() != SkPaint::kMiter_Join; 669 paint.getStrokeJoin() != SkPaint::kMiter_Join;
670 // another two reasons we might need to call drawPath... 670 // another two reasons we might need to call drawPath...
671 if (paint.getMaskFilter() || paint.getPathEffect()) { 671 if (paint.getMaskFilter() || paint.getPathEffect()) {
672 usePath = true; 672 usePath = true;
673 } 673 }
674 // until we aa rotated rects...
675 if (!usePath && paint.isAntiAlias() && !fContext->getMatrix().rectStaysRect( )) { 674 if (!usePath && paint.isAntiAlias() && !fContext->getMatrix().rectStaysRect( )) {
676 usePath = true; 675 #ifdef SHADER_AA_FILL_RECT
676 if (doStroke) {
677 #endif
678 usePath = true;
679 #ifdef SHADER_AA_FILL_RECT
680 } else {
681 usePath = !fContext->getMatrix().preservesRightAngles();
682 }
683 #endif
677 } 684 }
678 // small miter limit means right angles show bevel... 685 // small miter limit means right angles show bevel...
679 if (SkPaint::kMiter_Join == paint.getStrokeJoin() && 686 if (SkPaint::kMiter_Join == paint.getStrokeJoin() &&
680 paint.getStrokeMiter() < SK_ScalarSqrt2) 687 paint.getStrokeMiter() < SK_ScalarSqrt2)
681 { 688 {
682 usePath = true; 689 usePath = true;
683 } 690 }
684 // until we can both stroke and fill rectangles 691 // until we can both stroke and fill rectangles
685 if (paint.getStyle() == SkPaint::kStrokeAndFill_Style) { 692 if (paint.getStyle() == SkPaint::kStrokeAndFill_Style) {
686 usePath = true; 693 usePath = true;
(...skipping 1132 matching lines...) Expand 10 before | Expand all | Expand 10 after
1819 GrTexture* texture, 1826 GrTexture* texture,
1820 bool needClear) 1827 bool needClear)
1821 : SkDevice(make_bitmap(context, texture->asRenderTarget())) { 1828 : SkDevice(make_bitmap(context, texture->asRenderTarget())) {
1822 1829
1823 GrAssert(texture && texture->asRenderTarget()); 1830 GrAssert(texture && texture->asRenderTarget());
1824 // This constructor is called from onCreateCompatibleDevice. It has locked t he RT in the texture 1831 // This constructor is called from onCreateCompatibleDevice. It has locked t he RT in the texture
1825 // cache. We pass true for the third argument so that it will get unlocked. 1832 // cache. We pass true for the third argument so that it will get unlocked.
1826 this->initFromRenderTarget(context, texture->asRenderTarget(), true); 1833 this->initFromRenderTarget(context, texture->asRenderTarget(), true);
1827 fNeedClear = needClear; 1834 fNeedClear = needClear;
1828 } 1835 }
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