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

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

Issue 1518933002: Use SK_BUILD_FOR_ANDROID_FRAMEWORK in compose (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Update comment - Android ignores the paint's alpha Created 5 years 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 2006 The Android Open Source Project 3 * Copyright 2006 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 "SkComposeShader.h" 10 #include "SkComposeShader.h"
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 // larger is better (fewer times we have to loop), but we shouldn't 130 // larger is better (fewer times we have to loop), but we shouldn't
131 // take up too much stack-space (each element is 4 bytes) 131 // take up too much stack-space (each element is 4 bytes)
132 #define TMP_COLOR_COUNT 64 132 #define TMP_COLOR_COUNT 64
133 133
134 void SkComposeShader::ComposeShaderContext::shadeSpan(int x, int y, SkPMColor re sult[], int count) { 134 void SkComposeShader::ComposeShaderContext::shadeSpan(int x, int y, SkPMColor re sult[], int count) {
135 SkShader::Context* shaderContextA = fShaderContextA; 135 SkShader::Context* shaderContextA = fShaderContextA;
136 SkShader::Context* shaderContextB = fShaderContextB; 136 SkShader::Context* shaderContextB = fShaderContextB;
137 SkXfermode* mode = static_cast<const SkComposeShader&>(fShader).fMode ; 137 SkXfermode* mode = static_cast<const SkComposeShader&>(fShader).fMode ;
138 unsigned scale = SkAlpha255To256(this->getPaintAlpha()); 138 unsigned scale = SkAlpha255To256(this->getPaintAlpha());
139 139
140 #ifdef SK_BUILD_FOR_ANDROID 140 #ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK
141 scale = 256; // ugh -- maintain old bug/behavior for now 141 // In the Android framework, make compose shader ignore the paint's alpha.
142 // This matches the old behavior. FIXME: Can we remove this difference?
143 scale = 256;
142 #endif 144 #endif
143 145
144 SkPMColor tmp[TMP_COLOR_COUNT]; 146 SkPMColor tmp[TMP_COLOR_COUNT];
145 147
146 if (nullptr == mode) { // implied SRC_OVER 148 if (nullptr == mode) { // implied SRC_OVER
147 // TODO: when we have a good test-case, should use SkBlitRow::Proc32 149 // TODO: when we have a good test-case, should use SkBlitRow::Proc32
148 // for these loops 150 // for these loops
149 do { 151 do {
150 int n = count; 152 int n = count;
151 if (n > TMP_COLOR_COUNT) { 153 if (n > TMP_COLOR_COUNT) {
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 if (fMode) { 251 if (fMode) {
250 str->append(" Xfermode: "); 252 str->append(" Xfermode: ");
251 fMode->toString(str); 253 fMode->toString(str);
252 } 254 }
253 255
254 this->INHERITED::toString(str); 256 this->INHERITED::toString(str);
255 257
256 str->append(")"); 258 str->append(")");
257 } 259 }
258 #endif 260 #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