blob: fad65ec8bcc9343e174e66d06e85676248b84971 [file]
/*
* Copyright (C) 2026 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include <string>
#include <binder/Parcelable.h>
#include <gui/SurfaceComposerClient.h>
#include <utils/StrongPointer.h>
namespace android {
class SurfaceControl;
namespace view {
class SurfaceControl : public Parcelable {
public:
using Transaction = SurfaceComposerClient::Transaction;
SurfaceControl() = default;
SurfaceControl(const sp<android::SurfaceControl>& surfaceControl);
status_t readFromParcel(const Parcel* parcel) override;
status_t writeToParcel(Parcel* parcel) const override;
operator sp<android::SurfaceControl>() const;
operator bool() const;
android::SurfaceControl* operator->() const;
// Necessary to store SurfaceControl in an AIDL Parcelable
bool operator==(const SurfaceControl& other) const;
bool operator<(const SurfaceControl& other) const;
std::string toString() const;
private:
sp<android::SurfaceControl> mSurfaceControl;
};
} // namespace view
} // namespace android