blob: b9cbfa6d6b820b72749d445234c6432f00a7d7fe [file] [log] [blame]
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -08001/*
2 * Copyright (C) 2007 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#define LOG_TAG "Surface"
18
19#include <stdint.h>
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080020#include <errno.h>
21#include <sys/types.h>
22#include <sys/stat.h>
23
Mathias Agopianb0e76f42012-03-23 14:15:44 -070024#include <android/native_window.h>
25
Mathias Agopiancbb288b2009-09-07 16:32:45 -070026#include <utils/CallStack.h>
Mathias Agopiana67932f2011-04-20 14:20:59 -070027#include <utils/Errors.h>
Mathias Agopian9cce3252010-02-09 17:46:37 -080028#include <utils/Log.h>
Mathias Agopiana67932f2011-04-20 14:20:59 -070029#include <utils/threads.h>
Mathias Agopian9cce3252010-02-09 17:46:37 -080030
Mathias Agopiana67932f2011-04-20 14:20:59 -070031#include <binder/IPCThreadState.h>
32
Mathias Agopian076b1cc2009-04-10 14:24:30 -070033#include <ui/DisplayInfo.h>
Mathias Agopian3330b202009-10-05 17:07:12 -070034#include <ui/GraphicBuffer.h>
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080035#include <ui/Rect.h>
36
Mathias Agopian90ac7992012-02-25 18:48:35 -080037#include <gui/ISurface.h>
38#include <gui/ISurfaceComposer.h>
39#include <gui/Surface.h>
40#include <gui/SurfaceComposerClient.h>
41#include <gui/SurfaceTextureClient.h>
Mathias Agopian076b1cc2009-04-10 14:24:30 -070042
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080043namespace android {
44
Mathias Agopian62185b72009-04-16 16:19:50 -070045// ============================================================================
46// SurfaceControl
47// ============================================================================
48
Mathias Agopian01b76682009-04-16 20:04:08 -070049SurfaceControl::SurfaceControl(
50 const sp<SurfaceComposerClient>& client,
Mathias Agopian62185b72009-04-16 16:19:50 -070051 const sp<ISurface>& surface,
Mathias Agopianc10d9d92011-07-20 16:46:11 -070052 const ISurfaceComposerClient::surface_data_t& data)
Mathias Agopian62185b72009-04-16 16:19:50 -070053 : mClient(client), mSurface(surface),
Mathias Agopianc10d9d92011-07-20 16:46:11 -070054 mToken(data.token), mIdentity(data.identity)
Mathias Agopian62185b72009-04-16 16:19:50 -070055{
56}
Mathias Agopian18d84462009-04-16 20:30:22 -070057
Mathias Agopian62185b72009-04-16 16:19:50 -070058SurfaceControl::~SurfaceControl()
59{
60 destroy();
61}
62
63void SurfaceControl::destroy()
64{
Mathias Agopian18d84462009-04-16 20:30:22 -070065 if (isValid()) {
Mathias Agopian62185b72009-04-16 16:19:50 -070066 mClient->destroySurface(mToken);
67 }
68
69 // clear all references and trigger an IPC now, to make sure things
70 // happen without delay, since these resources are quite heavy.
71 mClient.clear();
72 mSurface.clear();
73 IPCThreadState::self()->flushCommands();
74}
75
76void SurfaceControl::clear()
77{
78 // here, the window manager tells us explicitly that we should destroy
79 // the surface's resource. Soon after this call, it will also release
80 // its last reference (which will call the dtor); however, it is possible
81 // that a client living in the same process still holds references which
82 // would delay the call to the dtor -- that is why we need this explicit
83 // "clear()" call.
84 destroy();
85}
86
Mathias Agopian62185b72009-04-16 16:19:50 -070087bool SurfaceControl::isSameSurface(
88 const sp<SurfaceControl>& lhs, const sp<SurfaceControl>& rhs)
89{
90 if (lhs == 0 || rhs == 0)
91 return false;
92 return lhs->mSurface->asBinder() == rhs->mSurface->asBinder();
93}
94
Mathias Agopian01b76682009-04-16 20:04:08 -070095status_t SurfaceControl::setLayer(int32_t layer) {
Mathias Agopian963abad2009-11-13 15:26:29 -080096 status_t err = validate();
Mathias Agopian01b76682009-04-16 20:04:08 -070097 if (err < 0) return err;
Mathias Agopian631f3582010-05-25 17:51:34 -070098 const sp<SurfaceComposerClient>& client(mClient);
Mathias Agopian01b76682009-04-16 20:04:08 -070099 return client->setLayer(mToken, layer);
100}
101status_t SurfaceControl::setPosition(int32_t x, int32_t y) {
Mathias Agopian963abad2009-11-13 15:26:29 -0800102 status_t err = validate();
Mathias Agopian01b76682009-04-16 20:04:08 -0700103 if (err < 0) return err;
Mathias Agopian631f3582010-05-25 17:51:34 -0700104 const sp<SurfaceComposerClient>& client(mClient);
Mathias Agopian01b76682009-04-16 20:04:08 -0700105 return client->setPosition(mToken, x, y);
106}
107status_t SurfaceControl::setSize(uint32_t w, uint32_t h) {
Mathias Agopian963abad2009-11-13 15:26:29 -0800108 status_t err = validate();
Mathias Agopian01b76682009-04-16 20:04:08 -0700109 if (err < 0) return err;
Mathias Agopian631f3582010-05-25 17:51:34 -0700110 const sp<SurfaceComposerClient>& client(mClient);
Mathias Agopian01b76682009-04-16 20:04:08 -0700111 return client->setSize(mToken, w, h);
112}
113status_t SurfaceControl::hide() {
Mathias Agopian963abad2009-11-13 15:26:29 -0800114 status_t err = validate();
Mathias Agopian01b76682009-04-16 20:04:08 -0700115 if (err < 0) return err;
Mathias Agopian631f3582010-05-25 17:51:34 -0700116 const sp<SurfaceComposerClient>& client(mClient);
Mathias Agopian01b76682009-04-16 20:04:08 -0700117 return client->hide(mToken);
118}
119status_t SurfaceControl::show(int32_t layer) {
Mathias Agopian963abad2009-11-13 15:26:29 -0800120 status_t err = validate();
Mathias Agopian01b76682009-04-16 20:04:08 -0700121 if (err < 0) return err;
Mathias Agopian631f3582010-05-25 17:51:34 -0700122 const sp<SurfaceComposerClient>& client(mClient);
Mathias Agopian01b76682009-04-16 20:04:08 -0700123 return client->show(mToken, layer);
124}
Mathias Agopian01b76682009-04-16 20:04:08 -0700125status_t SurfaceControl::setFlags(uint32_t flags, uint32_t mask) {
Mathias Agopian963abad2009-11-13 15:26:29 -0800126 status_t err = validate();
Mathias Agopian01b76682009-04-16 20:04:08 -0700127 if (err < 0) return err;
Mathias Agopian631f3582010-05-25 17:51:34 -0700128 const sp<SurfaceComposerClient>& client(mClient);
Mathias Agopian01b76682009-04-16 20:04:08 -0700129 return client->setFlags(mToken, flags, mask);
130}
131status_t SurfaceControl::setTransparentRegionHint(const Region& transparent) {
Mathias Agopian963abad2009-11-13 15:26:29 -0800132 status_t err = validate();
Mathias Agopian01b76682009-04-16 20:04:08 -0700133 if (err < 0) return err;
Mathias Agopian631f3582010-05-25 17:51:34 -0700134 const sp<SurfaceComposerClient>& client(mClient);
Mathias Agopian01b76682009-04-16 20:04:08 -0700135 return client->setTransparentRegionHint(mToken, transparent);
136}
137status_t SurfaceControl::setAlpha(float alpha) {
Mathias Agopian963abad2009-11-13 15:26:29 -0800138 status_t err = validate();
Mathias Agopian01b76682009-04-16 20:04:08 -0700139 if (err < 0) return err;
Mathias Agopian631f3582010-05-25 17:51:34 -0700140 const sp<SurfaceComposerClient>& client(mClient);
Mathias Agopian01b76682009-04-16 20:04:08 -0700141 return client->setAlpha(mToken, alpha);
142}
143status_t SurfaceControl::setMatrix(float dsdx, float dtdx, float dsdy, float dtdy) {
Mathias Agopian963abad2009-11-13 15:26:29 -0800144 status_t err = validate();
Mathias Agopian01b76682009-04-16 20:04:08 -0700145 if (err < 0) return err;
Mathias Agopian631f3582010-05-25 17:51:34 -0700146 const sp<SurfaceComposerClient>& client(mClient);
Mathias Agopian01b76682009-04-16 20:04:08 -0700147 return client->setMatrix(mToken, dsdx, dtdx, dsdy, dtdy);
148}
Jamie Gennisf15a83f2012-05-10 20:43:55 -0700149status_t SurfaceControl::setCrop(const Rect& crop) {
150 status_t err = validate();
151 if (err < 0) return err;
152 const sp<SurfaceComposerClient>& client(mClient);
153 return client->setCrop(mToken, crop);
154}
Mathias Agopian62185b72009-04-16 16:19:50 -0700155
Mathias Agopian963abad2009-11-13 15:26:29 -0800156status_t SurfaceControl::validate() const
Mathias Agopian62185b72009-04-16 16:19:50 -0700157{
158 if (mToken<0 || mClient==0) {
Steve Blocke6f43dd2012-01-06 19:20:56 +0000159 ALOGE("invalid token (%d, identity=%u) or client (%p)",
Mathias Agopian62185b72009-04-16 16:19:50 -0700160 mToken, mIdentity, mClient.get());
161 return NO_INIT;
162 }
Mathias Agopian62185b72009-04-16 16:19:50 -0700163 return NO_ERROR;
164}
165
Mathias Agopian01b76682009-04-16 20:04:08 -0700166status_t SurfaceControl::writeSurfaceToParcel(
167 const sp<SurfaceControl>& control, Parcel* parcel)
168{
Mathias Agopian579b3f82010-06-08 19:54:15 -0700169 sp<ISurface> sur;
Mathias Agopian01b76682009-04-16 20:04:08 -0700170 uint32_t identity = 0;
Mathias Agopian01b76682009-04-16 20:04:08 -0700171 if (SurfaceControl::isValid(control)) {
Mathias Agopian01b76682009-04-16 20:04:08 -0700172 sur = control->mSurface;
Mathias Agopian579b3f82010-06-08 19:54:15 -0700173 identity = control->mIdentity;
Mathias Agopian01b76682009-04-16 20:04:08 -0700174 }
Mathias Agopianb7e930d2010-06-01 15:12:58 -0700175 parcel->writeStrongBinder(sur!=0 ? sur->asBinder() : NULL);
Ted Bonkenburgbd050ab2011-07-15 15:10:10 -0700176 parcel->writeStrongBinder(NULL); // NULL ISurfaceTexture in this case.
Mathias Agopian01b76682009-04-16 20:04:08 -0700177 parcel->writeInt32(identity);
Mathias Agopian01b76682009-04-16 20:04:08 -0700178 return NO_ERROR;
179}
180
181sp<Surface> SurfaceControl::getSurface() const
182{
183 Mutex::Autolock _l(mLock);
184 if (mSurfaceData == 0) {
Ted Bonkenburgbd050ab2011-07-15 15:10:10 -0700185 sp<SurfaceControl> surface_control(const_cast<SurfaceControl*>(this));
186 mSurfaceData = new Surface(surface_control);
Mathias Agopian01b76682009-04-16 20:04:08 -0700187 }
188 return mSurfaceData;
189}
190
Mathias Agopian076b1cc2009-04-10 14:24:30 -0700191// ============================================================================
192// Surface
193// ============================================================================
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800194
Mathias Agopianb7e930d2010-06-01 15:12:58 -0700195// ---------------------------------------------------------------------------
196
Mathias Agopian01b76682009-04-16 20:04:08 -0700197Surface::Surface(const sp<SurfaceControl>& surface)
Mathias Agopian8f9dbf92011-07-13 17:39:11 -0700198 : SurfaceTextureClient(),
Mathias Agopianb7e930d2010-06-01 15:12:58 -0700199 mSurface(surface->mSurface),
Mathias Agopianc10d9d92011-07-20 16:46:11 -0700200 mIdentity(surface->mIdentity)
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800201{
Ted Bonkenburgbd050ab2011-07-15 15:10:10 -0700202 sp<ISurfaceTexture> st;
203 if (mSurface != NULL) {
204 st = mSurface->getSurfaceTexture();
205 }
206 init(st);
Mathias Agopian01b76682009-04-16 20:04:08 -0700207}
Mathias Agopian62185b72009-04-16 16:19:50 -0700208
Mathias Agopiana0c30e92010-06-04 18:26:32 -0700209Surface::Surface(const Parcel& parcel, const sp<IBinder>& ref)
Mathias Agopianc10d9d92011-07-20 16:46:11 -0700210 : SurfaceTextureClient()
Mathias Agopian01b76682009-04-16 20:04:08 -0700211{
Ted Bonkenburgbd050ab2011-07-15 15:10:10 -0700212 mSurface = interface_cast<ISurface>(ref);
213 sp<IBinder> st_binder(parcel.readStrongBinder());
214 sp<ISurfaceTexture> st;
215 if (st_binder != NULL) {
216 st = interface_cast<ISurfaceTexture>(st_binder);
217 } else if (mSurface != NULL) {
218 st = mSurface->getSurfaceTexture();
219 }
220
Mathias Agopian01b76682009-04-16 20:04:08 -0700221 mIdentity = parcel.readInt32();
Ted Bonkenburgbd050ab2011-07-15 15:10:10 -0700222 init(st);
223}
224
225Surface::Surface(const sp<ISurfaceTexture>& st)
226 : SurfaceTextureClient(),
227 mSurface(NULL),
228 mIdentity(0)
229{
230 init(st);
Mathias Agopian01b76682009-04-16 20:04:08 -0700231}
232
Mathias Agopian579b3f82010-06-08 19:54:15 -0700233status_t Surface::writeToParcel(
234 const sp<Surface>& surface, Parcel* parcel)
235{
236 sp<ISurface> sur;
Ted Bonkenburgbd050ab2011-07-15 15:10:10 -0700237 sp<ISurfaceTexture> st;
Mathias Agopian579b3f82010-06-08 19:54:15 -0700238 uint32_t identity = 0;
Mathias Agopian579b3f82010-06-08 19:54:15 -0700239 if (Surface::isValid(surface)) {
240 sur = surface->mSurface;
Ted Bonkenburgbd050ab2011-07-15 15:10:10 -0700241 st = surface->getISurfaceTexture();
Mathias Agopian579b3f82010-06-08 19:54:15 -0700242 identity = surface->mIdentity;
Ted Bonkenburgbd050ab2011-07-15 15:10:10 -0700243 } else if (surface != 0 &&
244 (surface->mSurface != NULL ||
245 surface->getISurfaceTexture() != NULL)) {
Steve Blocke6f43dd2012-01-06 19:20:56 +0000246 ALOGE("Parceling invalid surface with non-NULL ISurface/ISurfaceTexture as NULL: "
Ted Bonkenburgbd050ab2011-07-15 15:10:10 -0700247 "mSurface = %p, surfaceTexture = %p, mIdentity = %d, ",
248 surface->mSurface.get(), surface->getISurfaceTexture().get(),
249 surface->mIdentity);
Mathias Agopian579b3f82010-06-08 19:54:15 -0700250 }
Ted Bonkenburgbd050ab2011-07-15 15:10:10 -0700251
252 parcel->writeStrongBinder(sur != NULL ? sur->asBinder() : NULL);
253 parcel->writeStrongBinder(st != NULL ? st->asBinder() : NULL);
Mathias Agopian579b3f82010-06-08 19:54:15 -0700254 parcel->writeInt32(identity);
Mathias Agopian579b3f82010-06-08 19:54:15 -0700255 return NO_ERROR;
256
257}
258
Jamie Gennisaca4e222010-07-15 17:29:15 -0700259Mutex Surface::sCachedSurfacesLock;
Mathias Agopian455d18d2010-12-13 16:47:31 -0800260DefaultKeyedVector<wp<IBinder>, wp<Surface> > Surface::sCachedSurfaces;
Jamie Gennisaca4e222010-07-15 17:29:15 -0700261
262sp<Surface> Surface::readFromParcel(const Parcel& data) {
263 Mutex::Autolock _l(sCachedSurfacesLock);
Mathias Agopiana0c30e92010-06-04 18:26:32 -0700264 sp<IBinder> binder(data.readStrongBinder());
Jamie Gennisaca4e222010-07-15 17:29:15 -0700265 sp<Surface> surface = sCachedSurfaces.valueFor(binder).promote();
266 if (surface == 0) {
267 surface = new Surface(data, binder);
268 sCachedSurfaces.add(binder, surface);
Ted Bonkenburge5d6eb82011-08-09 22:38:41 -0700269 } else {
270 // The Surface was found in the cache, but we still should clear any
271 // remaining data from the parcel.
272 data.readStrongBinder(); // ISurfaceTexture
273 data.readInt32(); // identity
Mathias Agopiana0c30e92010-06-04 18:26:32 -0700274 }
Ted Bonkenburgbd050ab2011-07-15 15:10:10 -0700275 if (surface->mSurface == NULL && surface->getISurfaceTexture() == NULL) {
276 surface = 0;
Jamie Gennisaca4e222010-07-15 17:29:15 -0700277 }
Mathias Agopian455d18d2010-12-13 16:47:31 -0800278 cleanCachedSurfacesLocked();
Jamie Gennisaca4e222010-07-15 17:29:15 -0700279 return surface;
280}
281
282// Remove the stale entries from the surface cache. This should only be called
283// with sCachedSurfacesLock held.
Mathias Agopian455d18d2010-12-13 16:47:31 -0800284void Surface::cleanCachedSurfacesLocked() {
Jamie Gennisaca4e222010-07-15 17:29:15 -0700285 for (int i = sCachedSurfaces.size()-1; i >= 0; --i) {
286 wp<Surface> s(sCachedSurfaces.valueAt(i));
287 if (s == 0 || s.promote() == 0) {
288 sCachedSurfaces.removeItemsAt(i);
289 }
290 }
Mathias Agopiana0c30e92010-06-04 18:26:32 -0700291}
292
Ted Bonkenburgbd050ab2011-07-15 15:10:10 -0700293void Surface::init(const sp<ISurfaceTexture>& surfaceTexture)
Mathias Agopian01b76682009-04-16 20:04:08 -0700294{
Ted Bonkenburgbd050ab2011-07-15 15:10:10 -0700295 if (mSurface != NULL || surfaceTexture != NULL) {
Steve Blocke6f43dd2012-01-06 19:20:56 +0000296 ALOGE_IF(surfaceTexture==0, "got a NULL ISurfaceTexture from ISurface");
Mathias Agopiana67932f2011-04-20 14:20:59 -0700297 if (surfaceTexture != NULL) {
Mathias Agopian8f9dbf92011-07-13 17:39:11 -0700298 setISurfaceTexture(surfaceTexture);
299 setUsage(GraphicBuffer::USAGE_HW_RENDER);
Mathias Agopiana67932f2011-04-20 14:20:59 -0700300 }
Mathias Agopian631f3582010-05-25 17:51:34 -0700301
Mathias Agopiana67932f2011-04-20 14:20:59 -0700302 DisplayInfo dinfo;
303 SurfaceComposerClient::getDisplayInfo(0, &dinfo);
304 const_cast<float&>(ANativeWindow::xdpi) = dinfo.xdpi;
305 const_cast<float&>(ANativeWindow::ydpi) = dinfo.ydpi;
Mathias Agopiana67932f2011-04-20 14:20:59 -0700306 const_cast<uint32_t&>(ANativeWindow::flags) = 0;
Mathias Agopian631f3582010-05-25 17:51:34 -0700307 }
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800308}
309
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800310Surface::~Surface()
311{
Mathias Agopian40b7f6e2009-04-14 18:21:47 -0700312 // clear all references and trigger an IPC now, to make sure things
313 // happen without delay, since these resources are quite heavy.
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800314 mSurface.clear();
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800315 IPCThreadState::self()->flushCommands();
316}
317
Mathias Agopian631f3582010-05-25 17:51:34 -0700318bool Surface::isValid() {
Mathias Agopianc10d9d92011-07-20 16:46:11 -0700319 return getISurfaceTexture() != NULL;
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800320}
321
tedbo1e7fa9e2011-06-22 15:52:53 -0700322sp<ISurfaceTexture> Surface::getSurfaceTexture() {
Mathias Agopianc10d9d92011-07-20 16:46:11 -0700323 return getISurfaceTexture();
tedbo1e7fa9e2011-06-22 15:52:53 -0700324}
325
Mathias Agopian47d87302011-04-05 15:44:20 -0700326sp<IBinder> Surface::asBinder() const {
327 return mSurface!=0 ? mSurface->asBinder() : 0;
Mathias Agopian631f3582010-05-25 17:51:34 -0700328}
329
Mathias Agopian076b1cc2009-04-10 14:24:30 -0700330// ----------------------------------------------------------------------------
331
Mathias Agopiana67932f2011-04-20 14:20:59 -0700332int Surface::query(int what, int* value) const {
Mathias Agopiancb6b9042009-07-30 18:14:56 -0700333 switch (what) {
Jamie Gennis391bbe22011-03-14 15:00:06 -0700334 case NATIVE_WINDOW_CONCRETE_TYPE:
335 *value = NATIVE_WINDOW_SURFACE;
336 return NO_ERROR;
337 }
Mathias Agopian8f9dbf92011-07-13 17:39:11 -0700338 return SurfaceTextureClient::query(what, value);
Eino-Ville Talvala1d01a122011-02-18 11:02:42 -0800339}
340
Mathias Agopiana138f892010-05-21 17:24:35 -0700341// ----------------------------------------------------------------------------
342
Mathias Agopian87a96ea2011-08-23 21:09:41 -0700343status_t Surface::lock(SurfaceInfo* other, Region* inOutDirtyRegion) {
Mathias Agopian8f9dbf92011-07-13 17:39:11 -0700344 ANativeWindow_Buffer outBuffer;
Mathias Agopian55fa2512010-03-11 15:06:54 -0800345
Mathias Agopian8f9dbf92011-07-13 17:39:11 -0700346 ARect temp;
347 ARect* inOutDirtyBounds = NULL;
Mathias Agopian87a96ea2011-08-23 21:09:41 -0700348 if (inOutDirtyRegion) {
349 temp = inOutDirtyRegion->getBounds();
Mathias Agopian8f9dbf92011-07-13 17:39:11 -0700350 inOutDirtyBounds = &temp;
Mathias Agopian55fa2512010-03-11 15:06:54 -0800351 }
352
Mathias Agopian8f9dbf92011-07-13 17:39:11 -0700353 status_t err = SurfaceTextureClient::lock(&outBuffer, inOutDirtyBounds);
Mathias Agopian90147262010-01-22 11:47:55 -0800354
Mathias Agopian076b1cc2009-04-10 14:24:30 -0700355 if (err == NO_ERROR) {
Mathias Agopian8f9dbf92011-07-13 17:39:11 -0700356 other->w = uint32_t(outBuffer.width);
357 other->h = uint32_t(outBuffer.height);
358 other->s = uint32_t(outBuffer.stride);
359 other->usage = GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_SW_WRITE_OFTEN;
360 other->format = uint32_t(outBuffer.format);
361 other->bits = outBuffer.bits;
Mathias Agopian076b1cc2009-04-10 14:24:30 -0700362 }
Mathias Agopian87a96ea2011-08-23 21:09:41 -0700363
364 if (inOutDirtyRegion) {
365 inOutDirtyRegion->set( static_cast<Rect const&>(temp) );
366 }
367
Mathias Agopian076b1cc2009-04-10 14:24:30 -0700368 return err;
369}
Mathias Agopian076b1cc2009-04-10 14:24:30 -0700370
Mathias Agopian8f9dbf92011-07-13 17:39:11 -0700371status_t Surface::unlockAndPost() {
372 return SurfaceTextureClient::unlockAndPost();
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800373}
374
Mathias Agopiana138f892010-05-21 17:24:35 -0700375// ----------------------------------------------------------------------------
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800376}; // namespace android