| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 | 9 |
| 10 #include "GrContext.h" | 10 #include "GrContext.h" |
| (...skipping 955 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 966 | 966 |
| 967 /////////////////////////////////////////////////////////////////////////////// | 967 /////////////////////////////////////////////////////////////////////////////// |
| 968 | 968 |
| 969 void GrContext::drawRRect(const GrPaint& paint, | 969 void GrContext::drawRRect(const GrPaint& paint, |
| 970 const SkRRect& rect, | 970 const SkRRect& rect, |
| 971 const SkStrokeRec& stroke) { | 971 const SkStrokeRec& stroke) { |
| 972 | 972 |
| 973 GrDrawTarget* target = this->prepareToDraw(&paint, BUFFERED_DRAW); | 973 GrDrawTarget* target = this->prepareToDraw(&paint, BUFFERED_DRAW); |
| 974 GrDrawState::AutoStageDisable atr(fDrawState); | 974 GrDrawState::AutoStageDisable atr(fDrawState); |
| 975 | 975 |
| 976 bool prAA = paint.isAntiAlias() && !this->getRenderTarget()->isMultisampled(
); | 976 bool useAA = paint.isAntiAlias() && |
| 977 !this->getRenderTarget()->isMultisampled() && |
| 978 !disable_coverage_aa_for_blend(target); |
| 977 | 979 |
| 978 if (!fOvalRenderer->drawSimpleRRect(target, this, prAA, rect, stroke)) { | 980 if (!fOvalRenderer->drawSimpleRRect(target, this, useAA, rect, stroke)) { |
| 979 SkPath path; | 981 SkPath path; |
| 980 path.addRRect(rect); | 982 path.addRRect(rect); |
| 981 this->internalDrawPath(target, prAA, path, stroke); | 983 this->internalDrawPath(target, useAA, path, stroke); |
| 982 } | 984 } |
| 983 } | 985 } |
| 984 | 986 |
| 985 /////////////////////////////////////////////////////////////////////////////// | 987 /////////////////////////////////////////////////////////////////////////////// |
| 986 | 988 |
| 987 void GrContext::drawOval(const GrPaint& paint, | 989 void GrContext::drawOval(const GrPaint& paint, |
| 988 const GrRect& oval, | 990 const GrRect& oval, |
| 989 const SkStrokeRec& stroke) { | 991 const SkStrokeRec& stroke) { |
| 990 | 992 |
| 991 GrDrawTarget* target = this->prepareToDraw(&paint, BUFFERED_DRAW); | 993 GrDrawTarget* target = this->prepareToDraw(&paint, BUFFERED_DRAW); |
| 992 GrDrawState::AutoStageDisable atr(fDrawState); | 994 GrDrawState::AutoStageDisable atr(fDrawState); |
| 993 | 995 |
| 994 bool useAA = paint.isAntiAlias() && !this->getRenderTarget()->isMultisampled
(); | 996 bool useAA = paint.isAntiAlias() && |
| 997 !this->getRenderTarget()->isMultisampled() && |
| 998 !disable_coverage_aa_for_blend(target); |
| 995 | 999 |
| 996 if (!fOvalRenderer->drawOval(target, this, useAA, oval, stroke)) { | 1000 if (!fOvalRenderer->drawOval(target, this, useAA, oval, stroke)) { |
| 997 SkPath path; | 1001 SkPath path; |
| 998 path.addOval(oval); | 1002 path.addOval(oval); |
| 999 this->internalDrawPath(target, useAA, path, stroke); | 1003 this->internalDrawPath(target, useAA, path, stroke); |
| 1000 } | 1004 } |
| 1001 } | 1005 } |
| 1002 | 1006 |
| 1003 void GrContext::drawPath(const GrPaint& paint, const SkPath& path, const SkStrok
eRec& stroke) { | 1007 void GrContext::drawPath(const GrPaint& paint, const SkPath& path, const SkStrok
eRec& stroke) { |
| 1004 | 1008 |
| (...skipping 795 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1800 return srcTexture; | 1804 return srcTexture; |
| 1801 } | 1805 } |
| 1802 } | 1806 } |
| 1803 | 1807 |
| 1804 /////////////////////////////////////////////////////////////////////////////// | 1808 /////////////////////////////////////////////////////////////////////////////// |
| 1805 #if GR_CACHE_STATS | 1809 #if GR_CACHE_STATS |
| 1806 void GrContext::printCacheStats() const { | 1810 void GrContext::printCacheStats() const { |
| 1807 fTextureCache->printStats(); | 1811 fTextureCache->printStats(); |
| 1808 } | 1812 } |
| 1809 #endif | 1813 #endif |
| OLD | NEW |