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 956 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
967 target->setIndexSourceToArray(indices, indexCount); | 967 target->setIndexSourceToArray(indices, indexCount); |
968 target->drawIndexed(primitiveType, 0, 0, vertexCount, indexCount); | 968 target->drawIndexed(primitiveType, 0, 0, vertexCount, indexCount); |
969 target->resetIndexSource(); | 969 target->resetIndexSource(); |
970 } else { | 970 } else { |
971 target->drawNonIndexed(primitiveType, 0, vertexCount); | 971 target->drawNonIndexed(primitiveType, 0, vertexCount); |
972 } | 972 } |
973 } | 973 } |
974 | 974 |
975 /////////////////////////////////////////////////////////////////////////////// | 975 /////////////////////////////////////////////////////////////////////////////// |
976 | 976 |
| 977 void GrContext::drawRRect(const GrPaint& paint, |
| 978 const SkRRect& rect, |
| 979 const SkStrokeRec& stroke) { |
| 980 |
| 981 GrDrawTarget* target = this->prepareToDraw(&paint, BUFFERED_DRAW); |
| 982 GrDrawState::AutoStageDisable atr(fDrawState); |
| 983 |
| 984 if (!fOvalRenderer->drawSimpleRRect(target, this, paint, rect, stroke)) { |
| 985 SkPath path; |
| 986 path.addRRect(rect); |
| 987 this->internalDrawPath(target, paint, path, stroke); |
| 988 } |
| 989 } |
| 990 |
| 991 /////////////////////////////////////////////////////////////////////////////// |
| 992 |
977 void GrContext::drawOval(const GrPaint& paint, | 993 void GrContext::drawOval(const GrPaint& paint, |
978 const GrRect& oval, | 994 const GrRect& oval, |
979 const SkStrokeRec& stroke) { | 995 const SkStrokeRec& stroke) { |
980 | 996 |
981 GrDrawTarget* target = this->prepareToDraw(&paint, BUFFERED_DRAW); | 997 GrDrawTarget* target = this->prepareToDraw(&paint, BUFFERED_DRAW); |
982 GrDrawState::AutoStageDisable atr(fDrawState); | 998 GrDrawState::AutoStageDisable atr(fDrawState); |
983 | 999 |
984 if (!fOvalRenderer->drawOval(target, this, paint, oval, stroke)) { | 1000 if (!fOvalRenderer->drawOval(target, this, paint, oval, stroke)) { |
985 SkPath path; | 1001 SkPath path; |
986 path.addOval(oval); | 1002 path.addOval(oval); |
(...skipping 802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1789 return srcTexture; | 1805 return srcTexture; |
1790 } | 1806 } |
1791 } | 1807 } |
1792 | 1808 |
1793 /////////////////////////////////////////////////////////////////////////////// | 1809 /////////////////////////////////////////////////////////////////////////////// |
1794 #if GR_CACHE_STATS | 1810 #if GR_CACHE_STATS |
1795 void GrContext::printCacheStats() const { | 1811 void GrContext::printCacheStats() const { |
1796 fTextureCache->printStats(); | 1812 fTextureCache->printStats(); |
1797 } | 1813 } |
1798 #endif | 1814 #endif |
OLD | NEW |