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

Unified Diff: src/image/SkImageShader.cpp

Issue 2355703003: Avoid bitmap copy in SkMakeBitmapShader, fix hwui unit test (Closed)
Patch Set: Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests/ShaderTest.cpp » ('j') | tests/ShaderTest.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/image/SkImageShader.cpp
diff --git a/src/image/SkImageShader.cpp b/src/image/SkImageShader.cpp
index e52deff270d48775ed6918697b0e2bff6e2130f2..c1c1fd1e4de4e4deec337b6e89a0c14f3c86c272 100644
--- a/src/image/SkImageShader.cpp
+++ b/src/image/SkImageShader.cpp
@@ -97,7 +97,7 @@ static bool bitmap_is_too_big(int w, int h) {
// returns true and set color if the bitmap can be drawn as a single color
// (for efficiency)
static bool can_use_color_shader(const SkImage* image, SkColor* color) {
-#ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK
+#if 1
reed1 2016/09/20 17:19:06 what was wrong with the FRAMEWORK flag?
// HWUI does not support color shaders (see b/22390304)
return false;
#endif
@@ -244,7 +244,7 @@ sk_sp<SkShader> SkMakeBitmapShader(const SkBitmap& src, SkShader::TileMode tmx,
// or modify this assert.
SkASSERT(!allocator || (kNever_SkCopyPixelsMode == cpm));
- return SkImageShader::Make(SkMakeImageFromRasterBitmap(src, cpm, allocator),
+ return SkImageShader::Make(SkMakeImageFromRasterBitmap(src, kNever_SkCopyPixelsMode, allocator),
reed1 2016/09/20 17:19:05 Can the caller make the decision to pass in kNever
tmx, tmy, localMatrix, allocator);
}
« no previous file with comments | « no previous file | tests/ShaderTest.cpp » ('j') | tests/ShaderTest.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698