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

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

Issue 14495006: Minor optimization (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 7 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 | « no previous file | 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 /* 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 763 matching lines...) Expand 10 before | Expand all | Expand 10 after
774 774
775 void GrContext::drawRect(const GrPaint& paint, 775 void GrContext::drawRect(const GrPaint& paint,
776 const GrRect& rect, 776 const GrRect& rect,
777 SkScalar width, 777 SkScalar width,
778 const SkMatrix* matrix) { 778 const SkMatrix* matrix) {
779 SK_TRACE_EVENT0("GrContext::drawRect"); 779 SK_TRACE_EVENT0("GrContext::drawRect");
780 780
781 GrDrawTarget* target = this->prepareToDraw(&paint, BUFFERED_DRAW); 781 GrDrawTarget* target = this->prepareToDraw(&paint, BUFFERED_DRAW);
782 GrDrawState::AutoStageDisable atr(fDrawState); 782 GrDrawState::AutoStageDisable atr(fDrawState);
783 783
784 GrRect devRect = rect; 784 GrRect devRect;
785 SkMatrix combinedMatrix; 785 SkMatrix combinedMatrix;
786 bool useVertexCoverage; 786 bool useVertexCoverage;
787 bool needAA = paint.isAntiAlias() && 787 bool needAA = paint.isAntiAlias() &&
788 !this->getRenderTarget()->isMultisampled(); 788 !this->getRenderTarget()->isMultisampled();
789 bool doAA = needAA && apply_aa_to_rect(target, rect, width, matrix, 789 bool doAA = needAA && apply_aa_to_rect(target, rect, width, matrix,
790 &combinedMatrix, &devRect, 790 &combinedMatrix, &devRect,
791 &useVertexCoverage); 791 &useVertexCoverage);
792 if (doAA) { 792 if (doAA) {
793 GrDrawState::AutoDeviceCoordDraw adcd(target->drawState()); 793 GrDrawState::AutoDeviceCoordDraw adcd(target->drawState());
794 if (!adcd.succeeded()) { 794 if (!adcd.succeeded()) {
(...skipping 1009 matching lines...) Expand 10 before | Expand all | Expand 10 after
1804 return srcTexture; 1804 return srcTexture;
1805 } 1805 }
1806 } 1806 }
1807 1807
1808 /////////////////////////////////////////////////////////////////////////////// 1808 ///////////////////////////////////////////////////////////////////////////////
1809 #if GR_CACHE_STATS 1809 #if GR_CACHE_STATS
1810 void GrContext::printCacheStats() const { 1810 void GrContext::printCacheStats() const {
1811 fTextureCache->printStats(); 1811 fTextureCache->printStats();
1812 } 1812 }
1813 #endif 1813 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698