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

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

Issue 13852049: Add GPU support for roundrects (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Add oval check to SkCanvas 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/core/SkDevice.cpp ('k') | src/gpu/GrOvalRenderer.cpp » ('j') | 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 /* 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
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
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
OLDNEW
« no previous file with comments | « src/core/SkDevice.cpp ('k') | src/gpu/GrOvalRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698