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

Side by Side Diff: src/core/SkPicture.cpp

Issue 313433003: invert comparison sense for reason return (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 6 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
« 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 2007 The Android Open Source Project 3 * Copyright 2007 The Android Open Source Project
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 "SkPictureFlat.h" 10 #include "SkPictureFlat.h"
(...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after
657 bool SkPicture::suitableForGpuRasterization(GrContext* context, const char **rea son) const { 657 bool SkPicture::suitableForGpuRasterization(GrContext* context, const char **rea son) const {
658 // TODO: the heuristic used here needs to be refined 658 // TODO: the heuristic used here needs to be refined
659 static const int kNumPaintWithPathEffectUsesTol = 1; 659 static const int kNumPaintWithPathEffectUsesTol = 1;
660 static const int kNumAAConcavePaths = 5; 660 static const int kNumAAConcavePaths = 5;
661 661
662 SkASSERT(this->numAAHairlineConcavePaths() <= this->numAAConcavePaths()); 662 SkASSERT(this->numAAHairlineConcavePaths() <= this->numAAConcavePaths());
663 663
664 bool ret = this->numPaintWithPathEffectUses() < kNumPaintWithPathEffectUsesT ol && 664 bool ret = this->numPaintWithPathEffectUses() < kNumPaintWithPathEffectUsesT ol &&
665 (this->numAAConcavePaths()-this->numAAHairlineConcavePaths()) < k NumAAConcavePaths; 665 (this->numAAConcavePaths()-this->numAAHairlineConcavePaths()) < k NumAAConcavePaths;
666 if (!ret && reason) { 666 if (!ret && reason) {
667 if (this->numPaintWithPathEffectUses() < kNumPaintWithPathEffectUsesTol) 667 if (this->numPaintWithPathEffectUses() >= kNumPaintWithPathEffectUsesTol )
668 *reason = "Too many path effects."; 668 *reason = "Too many path effects.";
669 else if ((this->numAAConcavePaths()-this->numAAHairlineConcavePaths()) < kNumAAConcavePaths) 669 else if ((this->numAAConcavePaths()-this->numAAHairlineConcavePaths()) > = kNumAAConcavePaths)
670 *reason = "Too many anti-aliased concave paths."; 670 *reason = "Too many anti-aliased concave paths.";
671 else
672 *reason = "Unknown reason for GPU unsuitability.";
671 } 673 }
672 return ret; 674 return ret;
673 } 675 }
674 #endif 676 #endif
675 677
676 bool SkPicture::willPlayBackBitmaps() const { 678 bool SkPicture::willPlayBackBitmaps() const {
677 if (!fPlayback) { 679 if (!fPlayback) {
678 return false; 680 return false;
679 } 681 }
680 return fPlayback->containsBitmaps(); 682 return fPlayback->containsBitmaps();
(...skipping 23 matching lines...) Expand all
704 if (NULL != fRecord) { 706 if (NULL != fRecord) {
705 SkASSERT(NULL == fPlayback); 707 SkASSERT(NULL == fPlayback);
706 return SK_InvalidGenID; 708 return SK_InvalidGenID;
707 } 709 }
708 710
709 if (SK_InvalidGenID == fUniqueID) { 711 if (SK_InvalidGenID == fUniqueID) {
710 fUniqueID = next_picture_generation_id(); 712 fUniqueID = next_picture_generation_id();
711 } 713 }
712 return fUniqueID; 714 return fUniqueID;
713 } 715 }
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