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/effects/SkColorFilters.cpp

Issue 1348583002: Make skpaint->grpaint flow work for composing draws (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: remove unused inheriteds to satisfy clang Created 5 years, 2 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 | « src/core/SkShader.cpp ('k') | src/effects/SkPerlinNoiseShader.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 * Copyright 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
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 "SkBlitRow.h" 8 #include "SkBlitRow.h"
9 #include "SkColorFilter.h" 9 #include "SkColorFilter.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 #include "GrBlend.h" 67 #include "GrBlend.h"
68 #include "GrInvariantOutput.h" 68 #include "GrInvariantOutput.h"
69 #include "effects/GrXfermodeFragmentProcessor.h" 69 #include "effects/GrXfermodeFragmentProcessor.h"
70 #include "effects/GrConstColorProcessor.h" 70 #include "effects/GrConstColorProcessor.h"
71 #include "SkGr.h" 71 #include "SkGr.h"
72 72
73 bool SkModeColorFilter::asFragmentProcessors(GrContext*, GrProcessorDataManager* , 73 bool SkModeColorFilter::asFragmentProcessors(GrContext*, GrProcessorDataManager* ,
74 SkTDArray<const GrFragmentProcessor *>* array) const { 74 SkTDArray<const GrFragmentProcessor *>* array) const {
75 if (SkXfermode::kDst_Mode != fMode) { 75 if (SkXfermode::kDst_Mode != fMode) {
76 SkAutoTUnref<const GrFragmentProcessor> constFP( 76 SkAutoTUnref<const GrFragmentProcessor> constFP(
77 GrConstColorProcessor::Create(SkColor2GrColor(fColor), 77 GrConstColorProcessor::Create(SkColorToPremulGrColor(fColor),
78 GrConstColorProcessor::kIgnore_InputMo de)); 78 GrConstColorProcessor::kIgnore_InputMo de));
79 const GrFragmentProcessor* fp = 79 const GrFragmentProcessor* fp =
80 GrXfermodeFragmentProcessor::CreateFromSrcProcessor(constFP, fMode); 80 GrXfermodeFragmentProcessor::CreateFromSrcProcessor(constFP, fMode);
81 if (fp) { 81 if (fp) {
82 #ifdef SK_DEBUG 82 #ifdef SK_DEBUG
83 // With a solid color input this should always be able to compute th e blended color 83 // With a solid color input this should always be able to compute th e blended color
84 // (at least for coeff modes) 84 // (at least for coeff modes)
85 if (fMode <= SkXfermode::kLastCoeffMode) { 85 if (fMode <= SkXfermode::kLastCoeffMode) {
86 static SkRandom gRand; 86 static SkRandom gRand;
87 GrInvariantOutput io(GrPremulColor(gRand.nextU()), kRGBA_GrColor ComponentFlags, 87 GrInvariantOutput io(GrPremulColor(gRand.nextU()), kRGBA_GrColor ComponentFlags,
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 byte_to_scale(SkColorGetG(mul)), 192 byte_to_scale(SkColorGetG(mul)),
193 byte_to_scale(SkColorGetB(mul)), 193 byte_to_scale(SkColorGetB(mul)),
194 1); 194 1);
195 matrix.postTranslate(SkIntToScalar(SkColorGetR(add)), 195 matrix.postTranslate(SkIntToScalar(SkColorGetR(add)),
196 SkIntToScalar(SkColorGetG(add)), 196 SkIntToScalar(SkColorGetG(add)),
197 SkIntToScalar(SkColorGetB(add)), 197 SkIntToScalar(SkColorGetB(add)),
198 0); 198 0);
199 return SkColorMatrixFilter::Create(matrix); 199 return SkColorMatrixFilter::Create(matrix);
200 } 200 }
201 201
OLDNEW
« no previous file with comments | « src/core/SkShader.cpp ('k') | src/effects/SkPerlinNoiseShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698