Merge "frameworks/native: composer-resources is a new shared library"
diff --git a/libs/gui/SurfaceComposerClient.cpp b/libs/gui/SurfaceComposerClient.cpp
index e6b1beb..40621e3 100644
--- a/libs/gui/SurfaceComposerClient.cpp
+++ b/libs/gui/SurfaceComposerClient.cpp
@@ -795,14 +795,15 @@
}
SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setMetadata(
- const sp<SurfaceControl>& sc, uint32_t key, std::vector<uint8_t> data) {
+ const sp<SurfaceControl>& sc, uint32_t key, const Parcel& p) {
layer_state_t* s = getLayerState(sc);
if (!s) {
mStatus = BAD_INDEX;
return *this;
}
s->what |= layer_state_t::eMetadataChanged;
- s->metadata.mMap[key] = std::move(data);
+
+ s->metadata.mMap[key] = {p.data(), p.data() + p.dataSize()};
registerSurfaceControlForCallback(sc);
return *this;
diff --git a/libs/gui/include/gui/LayerMetadata.h b/libs/gui/include/gui/LayerMetadata.h
index 47f0ced..d58e019 100644
--- a/libs/gui/include/gui/LayerMetadata.h
+++ b/libs/gui/include/gui/LayerMetadata.h
@@ -22,7 +22,12 @@
namespace android {
-enum { METADATA_OWNER_UID = 1, METADATA_WINDOW_TYPE = 2, METADATA_TASK_ID = 3 };
+enum {
+ METADATA_OWNER_UID = 1,
+ METADATA_WINDOW_TYPE = 2,
+ METADATA_TASK_ID = 3,
+ METADATA_MOUSE_CURSOR = 4,
+};
struct LayerMetadata : public Parcelable {
std::unordered_map<uint32_t, std::vector<uint8_t>> mMap;
diff --git a/libs/gui/include/gui/SurfaceComposerClient.h b/libs/gui/include/gui/SurfaceComposerClient.h
index 22ab62d..f303a03 100644
--- a/libs/gui/include/gui/SurfaceComposerClient.h
+++ b/libs/gui/include/gui/SurfaceComposerClient.h
@@ -379,8 +379,7 @@
Transaction& setCrop_legacy(const sp<SurfaceControl>& sc, const Rect& crop);
Transaction& setCornerRadius(const sp<SurfaceControl>& sc, float cornerRadius);
Transaction& setLayerStack(const sp<SurfaceControl>& sc, uint32_t layerStack);
- Transaction& setMetadata(const sp<SurfaceControl>& sc, uint32_t key,
- std::vector<uint8_t> data);
+ Transaction& setMetadata(const sp<SurfaceControl>& sc, uint32_t key, const Parcel& p);
// Defers applying any changes made in this transaction until the Layer
// identified by handle reaches the given frameNumber. If the Layer identified
// by handle is removed, then we will apply this transaction regardless of
diff --git a/services/surfaceflinger/ColorLayer.cpp b/services/surfaceflinger/ColorLayer.cpp
index b65d351..2ad7591 100644
--- a/services/surfaceflinger/ColorLayer.cpp
+++ b/services/surfaceflinger/ColorLayer.cpp
@@ -108,6 +108,10 @@
return mCompositionLayer;
}
+bool ColorLayer::isOpaque(const Layer::State& s) const {
+ return (s.flags & layer_state_t::eLayerOpaque) != 0;
+}
+
// ---------------------------------------------------------------------------
}; // namespace android
diff --git a/services/surfaceflinger/ColorLayer.h b/services/surfaceflinger/ColorLayer.h
index 015b939..c793142 100644
--- a/services/surfaceflinger/ColorLayer.h
+++ b/services/surfaceflinger/ColorLayer.h
@@ -39,6 +39,8 @@
void commitTransaction(const State& stateToCommit) override;
+ bool isOpaque(const Layer::State& s) const override;
+
protected:
/*
* compositionengine::LayerFE overrides
diff --git a/services/surfaceflinger/test.png b/services/surfaceflinger/test.png
deleted file mode 100644
index 773dcc3..0000000
--- a/services/surfaceflinger/test.png
+++ /dev/null
Binary files differ