| OLD | NEW |
| 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 Loading... |
| 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().notSkewOrPersp(); |
| 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 1171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1858 GrTexture* texture, | 1865 GrTexture* texture, |
| 1859 bool needClear) | 1866 bool needClear) |
| 1860 : SkDevice(make_bitmap(context, texture->asRenderTarget())) { | 1867 : SkDevice(make_bitmap(context, texture->asRenderTarget())) { |
| 1861 | 1868 |
| 1862 GrAssert(texture && texture->asRenderTarget()); | 1869 GrAssert(texture && texture->asRenderTarget()); |
| 1863 // This constructor is called from onCreateCompatibleDevice. It has locked t
he RT in the texture | 1870 // 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. | 1871 // cache. We pass true for the third argument so that it will get unlocked. |
| 1865 this->initFromRenderTarget(context, texture->asRenderTarget(), true); | 1872 this->initFromRenderTarget(context, texture->asRenderTarget(), true); |
| 1866 fNeedClear = needClear; | 1873 fNeedClear = needClear; |
| 1867 } | 1874 } |
| OLD | NEW |