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

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

Issue 1235913005: Disable optimization as HWUI does not yet support color shaders. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 5 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 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 #include "SkColorPriv.h" 8 #include "SkColorPriv.h"
9 #include "SkReadBuffer.h" 9 #include "SkReadBuffer.h"
10 #include "SkWriteBuffer.h" 10 #include "SkWriteBuffer.h"
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 261
262 /////////////////////////////////////////////////////////////////////////////// 262 ///////////////////////////////////////////////////////////////////////////////
263 263
264 #include "SkUnPreMultiply.h" 264 #include "SkUnPreMultiply.h"
265 #include "SkColorShader.h" 265 #include "SkColorShader.h"
266 #include "SkEmptyShader.h" 266 #include "SkEmptyShader.h"
267 267
268 // returns true and set color if the bitmap can be drawn as a single color 268 // returns true and set color if the bitmap can be drawn as a single color
269 // (for efficiency) 269 // (for efficiency)
270 static bool canUseColorShader(const SkBitmap& bm, SkColor* color) { 270 static bool canUseColorShader(const SkBitmap& bm, SkColor* color) {
271 #ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK
272 // HWUI does not support color shaders (see b/22390304)
273 return false;
274 #endif
275
271 if (1 != bm.width() || 1 != bm.height()) { 276 if (1 != bm.width() || 1 != bm.height()) {
272 return false; 277 return false;
273 } 278 }
274 279
275 SkAutoLockPixels alp(bm); 280 SkAutoLockPixels alp(bm);
276 if (!bm.readyToDraw()) { 281 if (!bm.readyToDraw()) {
277 return false; 282 return false;
278 } 283 }
279 284
280 switch (bm.colorType()) { 285 switch (bm.colorType()) {
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 #else 457 #else
453 458
454 bool SkBitmapProcShader::asFragmentProcessor(GrContext*, const SkPaint&, const S kMatrix&, 459 bool SkBitmapProcShader::asFragmentProcessor(GrContext*, const SkPaint&, const S kMatrix&,
455 const SkMatrix*, GrColor*, GrProces sorDataManager*, 460 const SkMatrix*, GrColor*, GrProces sorDataManager*,
456 GrFragmentProcessor**) const { 461 GrFragmentProcessor**) const {
457 SkDEBUGFAIL("Should not call in GPU-less build"); 462 SkDEBUGFAIL("Should not call in GPU-less build");
458 return false; 463 return false;
459 } 464 }
460 465
461 #endif 466 #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