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

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

Issue 724443002: Fix use of NULL ptr in GrContext::drawRect (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 1 month 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
« 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 #include "GrContext.h" 9 #include "GrContext.h"
10 10
(...skipping 748 matching lines...) Expand 10 before | Expand all | Expand 10 after
759 } 759 }
760 } 760 }
761 } 761 }
762 } 762 }
763 763
764 SkRect devBoundRect; 764 SkRect devBoundRect;
765 bool needAA = paint.isAntiAlias() && 765 bool needAA = paint.isAntiAlias() &&
766 !target->getDrawState().getRenderTarget()->isMultisampled(); 766 !target->getDrawState().getRenderTarget()->isMultisampled();
767 bool doAA = needAA && apply_aa_to_rect(target, rect, width, matrix, &devBoun dRect); 767 bool doAA = needAA && apply_aa_to_rect(target, rect, width, matrix, &devBoun dRect);
768 768
769 const SkStrokeRec& strokeRec = strokeInfo->getStrokeRec();
770
771 if (doAA) { 769 if (doAA) {
772 GrDrawState::AutoViewMatrixRestore avmr; 770 GrDrawState::AutoViewMatrixRestore avmr;
773 if (!avmr.setIdentity(target->drawState())) { 771 if (!avmr.setIdentity(target->drawState())) {
774 return; 772 return;
775 } 773 }
776 if (width >= 0) { 774 if (width >= 0) {
777 fAARectRenderer->strokeAARect(target, rect, 775 const SkStrokeRec& strokeRec = strokeInfo->getStrokeRec();
778 matrix, devBoundRect, 776 fAARectRenderer->strokeAARect(target, rect, matrix, devBoundRect, st rokeRec);
779 strokeRec);
780 } else { 777 } else {
781 // filled AA rect 778 // filled AA rect
782 fAARectRenderer->fillAARect(target, 779 fAARectRenderer->fillAARect(target,
783 rect, matrix, devBoundRect); 780 rect, matrix, devBoundRect);
784 } 781 }
785 return; 782 return;
786 } 783 }
787 784
788 if (width >= 0) { 785 if (width >= 0) {
789 // TODO: consider making static vertex buffers for these cases. 786 // TODO: consider making static vertex buffers for these cases.
(...skipping 990 matching lines...) Expand 10 before | Expand all | Expand 10 after
1780 fResourceCache->printStats(); 1777 fResourceCache->printStats();
1781 } 1778 }
1782 #endif 1779 #endif
1783 1780
1784 #if GR_GPU_STATS 1781 #if GR_GPU_STATS
1785 const GrContext::GPUStats* GrContext::gpuStats() const { 1782 const GrContext::GPUStats* GrContext::gpuStats() const {
1786 return fGpu->gpuStats(); 1783 return fGpu->gpuStats();
1787 } 1784 }
1788 #endif 1785 #endif
1789 1786
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