summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
author Jerome Gaillard <jgaillard@google.com> 2020-02-10 11:56:33 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2020-02-10 11:56:33 +0000
commit0eb6fbd6862934bccc119ea8ad659d4731b34f80 (patch)
tree17f419992e63de834ead9de3714c73c2db2e975e /libs
parentd9e45183cb43d2848f3182321912888de22b3bf0 (diff)
parent4c27c0ceab8e0a1f5a4ca3e9a6cc8793ff10fd9a (diff)
Merge changes Ia42a37c0,I644bc828
* changes: Make libandroid_runtime build on mac Make HWUI build for macOs
Diffstat (limited to 'libs')
-rw-r--r--libs/hwui/Android.bp2
-rw-r--r--libs/hwui/hwui/AnimatedImageDrawable.cpp6
2 files changed, 7 insertions, 1 deletions
diff --git a/libs/hwui/Android.bp b/libs/hwui/Android.bp
index 301d1afc6c13..debb38b2c1b0 100644
--- a/libs/hwui/Android.bp
+++ b/libs/hwui/Android.bp
@@ -171,7 +171,6 @@ cc_defaults {
"renderthread/RenderTask.cpp",
"renderthread/TimeLord.cpp",
"hwui/AnimatedImageDrawable.cpp",
- "hwui/AnimatedImageThread.cpp",
"hwui/Bitmap.cpp",
"hwui/Canvas.cpp",
"hwui/ImageDecoder.cpp",
@@ -213,6 +212,7 @@ cc_defaults {
android: {
srcs: [
+ "hwui/AnimatedImageThread.cpp",
"pipeline/skia/ATraceMemoryDump.cpp",
"pipeline/skia/GLFunctorDrawable.cpp",
"pipeline/skia/LayerDrawable.cpp",
diff --git a/libs/hwui/hwui/AnimatedImageDrawable.cpp b/libs/hwui/hwui/AnimatedImageDrawable.cpp
index 4544beae5df8..638de850a6c5 100644
--- a/libs/hwui/hwui/AnimatedImageDrawable.cpp
+++ b/libs/hwui/hwui/AnimatedImageDrawable.cpp
@@ -15,7 +15,9 @@
*/
#include "AnimatedImageDrawable.h"
+#ifdef __ANDROID__ // Layoutlib does not support AnimatedImageThread
#include "AnimatedImageThread.h"
+#endif
#include "utils/TraceUtils.h"
@@ -160,8 +162,10 @@ void AnimatedImageDrawable::onDraw(SkCanvas* canvas) {
} else if (starting) {
// The image has animated, and now is being reset. Queue up the first
// frame, but keep showing the current frame until the first is ready.
+#ifdef __ANDROID__ // Layoutlib does not support AnimatedImageThread
auto& thread = uirenderer::AnimatedImageThread::getInstance();
mNextSnapshot = thread.reset(sk_ref_sp(this));
+#endif
}
bool finalFrame = false;
@@ -187,8 +191,10 @@ void AnimatedImageDrawable::onDraw(SkCanvas* canvas) {
}
if (mRunning && !mNextSnapshot.valid()) {
+#ifdef __ANDROID__ // Layoutlib does not support AnimatedImageThread
auto& thread = uirenderer::AnimatedImageThread::getInstance();
mNextSnapshot = thread.decodeNextFrame(sk_ref_sp(this));
+#endif
}
if (!drawDirectly) {