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

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

Issue 2236423002: Inline fast path for GrPaint::isConstantBlendedColor when no color FPs and src-over blend. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 4 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 | « include/gpu/GrPaint.h ('k') | 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 * Copyright 2013 Google Inc. 2 * Copyright 2013 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "GrPaint.h" 8 #include "GrPaint.h"
9 9
10 #include "GrProcOptInfo.h" 10 #include "GrProcOptInfo.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 matrix, params)) ; 44 matrix, params)) ;
45 } 45 }
46 46
47 void GrPaint::addCoverageTextureProcessor(GrTexture* texture, 47 void GrPaint::addCoverageTextureProcessor(GrTexture* texture,
48 const SkMatrix& matrix, 48 const SkMatrix& matrix,
49 const GrTextureParams& params) { 49 const GrTextureParams& params) {
50 this->addCoverageFragmentProcessor(GrSimpleTextureEffect::Make(texture, null ptr, matrix, 50 this->addCoverageFragmentProcessor(GrSimpleTextureEffect::Make(texture, null ptr, matrix,
51 params)); 51 params));
52 } 52 }
53 53
54 bool GrPaint::isConstantBlendedColor(GrColor* color) const { 54 bool GrPaint::internalIsConstantBlendedColor(GrColor paintColor, GrColor* color) const {
55 GrProcOptInfo colorProcInfo; 55 GrProcOptInfo colorProcInfo;
56 colorProcInfo.calcWithInitialValues( 56 colorProcInfo.calcWithInitialValues(
57 sk_sp_address_as_pointer_address(fColorFragmentProcessors.begin()), 57 sk_sp_address_as_pointer_address(fColorFragmentProcessors.begin()),
58 this->numColorFragmentProcessors(), this->getColor(), kRGBA_GrColorCompo nentFlags, false); 58 this->numColorFragmentProcessors(), paintColor, kRGBA_GrColorComponentFl ags, false);
59 59
60 GrXPFactory::InvariantBlendedColor blendedColor; 60 GrXPFactory::InvariantBlendedColor blendedColor;
61 if (fXPFactory) { 61 if (fXPFactory) {
62 fXPFactory->getInvariantBlendedColor(colorProcInfo, &blendedColor); 62 fXPFactory->getInvariantBlendedColor(colorProcInfo, &blendedColor);
63 } else { 63 } else {
64 GrPorterDuffXPFactory::SrcOverInvariantBlendedColor(colorProcInfo.color( ), 64 GrPorterDuffXPFactory::SrcOverInvariantBlendedColor(colorProcInfo.color( ),
65 colorProcInfo.validF lags(), 65 colorProcInfo.validF lags(),
66 colorProcInfo.isOpaq ue(), 66 colorProcInfo.isOpaq ue(),
67 &blendedColor); 67 &blendedColor);
68 } 68 }
69 69
70 if (kRGBA_GrColorComponentFlags == blendedColor.fKnownColorFlags) { 70 if (kRGBA_GrColorComponentFlags == blendedColor.fKnownColorFlags) {
71 *color = blendedColor.fKnownColor; 71 *color = blendedColor.fKnownColor;
72 return true; 72 return true;
73 } 73 }
74 return false; 74 return false;
75 } 75 }
OLDNEW
« no previous file with comments | « include/gpu/GrPaint.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698