From 770492cb2b19f6a36ad748cd05fbedfbb9a67dfa Mon Sep 17 00:00:00 2001 From: Mathias Agopian Date: Fri, 28 May 2010 14:22:23 -0700 Subject: more clean-up in preparation of bigger changes the most important change here is the renaming of ISurfaceFlingerClient to ISurfaceComposerClient Change-Id: I94e18b0417f50e06f21377446639c61f65f959b3 --- include/private/surfaceflinger/SharedBufferStack.h | 3 +- include/surfaceflinger/ISurface.h | 14 +++ include/surfaceflinger/ISurfaceComposer.h | 4 +- include/surfaceflinger/ISurfaceComposerClient.h | 100 +++++++++++++++++++++ include/surfaceflinger/ISurfaceFlingerClient.h | 100 --------------------- include/surfaceflinger/Surface.h | 4 +- include/surfaceflinger/SurfaceComposerClient.h | 4 +- 7 files changed, 121 insertions(+), 108 deletions(-) create mode 100644 include/surfaceflinger/ISurfaceComposerClient.h delete mode 100644 include/surfaceflinger/ISurfaceFlingerClient.h (limited to 'include') diff --git a/include/private/surfaceflinger/SharedBufferStack.h b/include/private/surfaceflinger/SharedBufferStack.h index b859e78b75d7..dcce25e92329 100644 --- a/include/private/surfaceflinger/SharedBufferStack.h +++ b/include/private/surfaceflinger/SharedBufferStack.h @@ -136,9 +136,7 @@ class SharedClient public: SharedClient(); ~SharedClient(); - status_t validate(size_t token) const; - uint32_t getIdentity(size_t token) const; private: friend class SharedBufferBase; @@ -160,6 +158,7 @@ public: int32_t identity); ~SharedBufferBase(); status_t getStatus() const; + int32_t getIdentity() const; size_t getFrontBuffer() const; String8 dump(char const* prefix) const; diff --git a/include/surfaceflinger/ISurface.h b/include/surfaceflinger/ISurface.h index 18e7950bc39b..ddbe03dbccf0 100644 --- a/include/surfaceflinger/ISurface.h +++ b/include/surfaceflinger/ISurface.h @@ -53,10 +53,24 @@ protected: public: DECLARE_META_INTERFACE(Surface); + /* + * requests a new buffer for the given index. If w, h, or format are + * null the buffer is created with the parameters assigned to the + * surface it is bound to. Otherwise the buffer's parameters are + * set to those specified. + */ virtual sp requestBuffer(int bufferIdx, uint32_t w, uint32_t h, uint32_t format, uint32_t usage) = 0; + + /* + * sets the number of buffers dequeuable for this surface. + */ virtual status_t setBufferCount(int bufferCount) = 0; + // ------------------------------------------------------------------------ + // Deprecated... + // ------------------------------------------------------------------------ + class BufferHeap { public: enum { diff --git a/include/surfaceflinger/ISurfaceComposer.h b/include/surfaceflinger/ISurfaceComposer.h index d1e7785ccd60..3271cfd4753a 100644 --- a/include/surfaceflinger/ISurfaceComposer.h +++ b/include/surfaceflinger/ISurfaceComposer.h @@ -27,7 +27,7 @@ #include -#include +#include namespace android { // ---------------------------------------------------------------------------- @@ -86,7 +86,7 @@ public: * ACCESS_SURFACE_FLINGER permission */ - virtual sp createConnection() = 0; + virtual sp createConnection() = 0; /* retrieve the control block */ virtual sp getCblk() const = 0; diff --git a/include/surfaceflinger/ISurfaceComposerClient.h b/include/surfaceflinger/ISurfaceComposerClient.h new file mode 100644 index 000000000000..b2a4766bc40d --- /dev/null +++ b/include/surfaceflinger/ISurfaceComposerClient.h @@ -0,0 +1,100 @@ +/* + * Copyright (C) 2007 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. + */ + +#ifndef ANDROID_SF_ISURFACE_COMPOSER_CLIENT_H +#define ANDROID_SF_ISURFACE_COMPOSER_CLIENT_H + +#include +#include + +#include +#include + +#include + +#include + +#include + +namespace android { + +// ---------------------------------------------------------------------------- + +class IMemoryHeap; + +typedef int32_t ClientID; +typedef int32_t DisplayID; + +// ---------------------------------------------------------------------------- + +class layer_state_t; + +class ISurfaceComposerClient : public IInterface +{ +public: + DECLARE_META_INTERFACE(SurfaceComposerClient); + + struct surface_data_t { + int32_t token; + int32_t identity; + uint32_t width; + uint32_t height; + uint32_t format; + status_t readFromParcel(const Parcel& parcel); + status_t writeToParcel(Parcel* parcel) const; + }; + + virtual sp getControlBlock() const = 0; + + /* + * Requires ACCESS_SURFACE_FLINGER permission + */ + virtual sp createSurface( surface_data_t* data, + int pid, + const String8& name, + DisplayID display, + uint32_t w, + uint32_t h, + PixelFormat format, + uint32_t flags) = 0; + + /* + * Requires ACCESS_SURFACE_FLINGER permission + */ + virtual status_t destroySurface(SurfaceID sid) = 0; + + /* + * Requires ACCESS_SURFACE_FLINGER permission + */ + virtual status_t setState(int32_t count, const layer_state_t* states) = 0; +}; + +// ---------------------------------------------------------------------------- + +class BnSurfaceComposerClient : public BnInterface +{ +public: + virtual status_t onTransact( uint32_t code, + const Parcel& data, + Parcel* reply, + uint32_t flags = 0); +}; + +// ---------------------------------------------------------------------------- + +}; // namespace android + +#endif // ANDROID_SF_ISURFACE_COMPOSER_CLIENT_H diff --git a/include/surfaceflinger/ISurfaceFlingerClient.h b/include/surfaceflinger/ISurfaceFlingerClient.h deleted file mode 100644 index c96432feb047..000000000000 --- a/include/surfaceflinger/ISurfaceFlingerClient.h +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright (C) 2007 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. - */ - -#ifndef ANDROID_SF_ISURFACE_FLINGER_CLIENT_H -#define ANDROID_SF_ISURFACE_FLINGER_CLIENT_H - -#include -#include - -#include -#include - -#include - -#include - -#include - -namespace android { - -// ---------------------------------------------------------------------------- - -class IMemoryHeap; - -typedef int32_t ClientID; -typedef int32_t DisplayID; - -// ---------------------------------------------------------------------------- - -class layer_state_t; - -class ISurfaceFlingerClient : public IInterface -{ -public: - DECLARE_META_INTERFACE(SurfaceFlingerClient); - - struct surface_data_t { - int32_t token; - int32_t identity; - uint32_t width; - uint32_t height; - uint32_t format; - status_t readFromParcel(const Parcel& parcel); - status_t writeToParcel(Parcel* parcel) const; - }; - - virtual sp getControlBlock() const = 0; - - /* - * Requires ACCESS_SURFACE_FLINGER permission - */ - virtual sp createSurface( surface_data_t* data, - int pid, - const String8& name, - DisplayID display, - uint32_t w, - uint32_t h, - PixelFormat format, - uint32_t flags) = 0; - - /* - * Requires ACCESS_SURFACE_FLINGER permission - */ - virtual status_t destroySurface(SurfaceID sid) = 0; - - /* - * Requires ACCESS_SURFACE_FLINGER permission - */ - virtual status_t setState(int32_t count, const layer_state_t* states) = 0; -}; - -// ---------------------------------------------------------------------------- - -class BnSurfaceFlingerClient : public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -// ---------------------------------------------------------------------------- - -}; // namespace android - -#endif // ANDROID_SF_ISURFACE_FLINGER_CLIENT_H diff --git a/include/surfaceflinger/Surface.h b/include/surfaceflinger/Surface.h index 33269cbeab5c..295797066f80 100644 --- a/include/surfaceflinger/Surface.h +++ b/include/surfaceflinger/Surface.h @@ -28,7 +28,7 @@ #include #include -#include +#include #define ANDROID_VIEW_SURFACE_JNI_ID "mNativeSurface" @@ -108,7 +108,7 @@ private: SurfaceControl( const sp& client, const sp& surface, - const ISurfaceFlingerClient::surface_data_t& data, + const ISurfaceComposerClient::surface_data_t& data, uint32_t w, uint32_t h, PixelFormat format, uint32_t flags); ~SurfaceControl(); diff --git a/include/surfaceflinger/SurfaceComposerClient.h b/include/surfaceflinger/SurfaceComposerClient.h index 102aebc6fb36..8e28a815bf13 100644 --- a/include/surfaceflinger/SurfaceComposerClient.h +++ b/include/surfaceflinger/SurfaceComposerClient.h @@ -149,7 +149,7 @@ private: // these don't need to be protected because they never change // after assignment status_t mStatus; - sp mClient; + sp mClient; }; // --------------------------------------------------------------------------- @@ -161,7 +161,7 @@ class SurfaceClient : public RefBase SharedClient* mControl; sp mControlMemory; sp mConnection; - sp mSignalServer; + sp mComposerService; void init(const sp& conn); public: explicit SurfaceClient(const sp& conn); -- cgit v1.2.3-59-g8ed1b