blob: 62759103de386a848c500e1c2876b52fc72ff854 [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
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080017#include <stdlib.h>
18#include <stdint.h>
19#include <sys/types.h>
20
21#include <cutils/properties.h>
Mathias Agopian076b1cc2009-04-10 14:24:30 -070022#include <cutils/native_handle.h>
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080023
24#include <utils/Errors.h>
25#include <utils/Log.h>
26#include <utils/StopWatch.h>
27
28#include <ui/PixelFormat.h>
Mathias Agopian076b1cc2009-04-10 14:24:30 -070029#include <ui/Surface.h>
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080030
Mathias Agopiancbb288b2009-09-07 16:32:45 -070031#include "Buffer.h"
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080032#include "clz.h"
33#include "Layer.h"
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080034#include "SurfaceFlinger.h"
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080035#include "DisplayHardware/DisplayHardware.h"
36
37
38#define DEBUG_RESIZE 0
39
40
41namespace android {
42
43// ---------------------------------------------------------------------------
44
45const uint32_t Layer::typeInfo = LayerBaseClient::typeInfo | 4;
46const char* const Layer::typeID = "Layer";
47
48// ---------------------------------------------------------------------------
49
Mathias Agopiancbb288b2009-09-07 16:32:45 -070050Layer::Layer(SurfaceFlinger* flinger, DisplayID display,
51 const sp<Client>& c, int32_t i)
Mathias Agopian48d819a2009-09-10 19:41:18 -070052 : LayerBaseClient(flinger, display, c, i),
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080053 mSecure(false),
Mathias Agopiancbb288b2009-09-07 16:32:45 -070054 mNeedsBlending(true)
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080055{
56 // no OpenGL operation is possible here, since we might not be
57 // in the OpenGL thread.
Mathias Agopiancbb288b2009-09-07 16:32:45 -070058 mFrontBufferIndex = lcblk->getFrontBuffer();
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080059}
60
61Layer::~Layer()
62{
Mathias Agopian0aa758d2009-04-22 15:23:34 -070063 destroy();
64 // the actual buffers will be destroyed here
Mathias Agopian48d819a2009-09-10 19:41:18 -070065}
Mathias Agopiancbb288b2009-09-07 16:32:45 -070066
Mathias Agopian48d819a2009-09-10 19:41:18 -070067// called with SurfaceFlinger::mStateLock as soon as the layer is entered
68// in the purgatory list
69void Layer::onRemoved()
70{
71 // wake up the condition
72 lcblk->setStatus(NO_INIT);
Mathias Agopian0aa758d2009-04-22 15:23:34 -070073}
74
75void Layer::destroy()
76{
Mathias Agopiancbb288b2009-09-07 16:32:45 -070077 for (size_t i=0 ; i<NUM_BUFFERS ; i++) {
Mathias Agopian076b1cc2009-04-10 14:24:30 -070078 if (mTextures[i].name != -1U) {
Mathias Agopian550b79f2009-04-22 15:49:28 -070079 glDeleteTextures(1, &mTextures[i].name);
Mathias Agopian0aa758d2009-04-22 15:23:34 -070080 mTextures[i].name = -1U;
Mathias Agopian076b1cc2009-04-10 14:24:30 -070081 }
82 if (mTextures[i].image != EGL_NO_IMAGE_KHR) {
83 EGLDisplay dpy(mFlinger->graphicPlane(0).getEGLDisplay());
84 eglDestroyImageKHR(dpy, mTextures[i].image);
Mathias Agopian0aa758d2009-04-22 15:23:34 -070085 mTextures[i].image = EGL_NO_IMAGE_KHR;
Mathias Agopian076b1cc2009-04-10 14:24:30 -070086 }
Mathias Agopian48d819a2009-09-10 19:41:18 -070087 Mutex::Autolock _l(mLock);
Mathias Agopiancbb288b2009-09-07 16:32:45 -070088 mBuffers[i].clear();
Mathias Agopian48d819a2009-09-10 19:41:18 -070089 mWidth = mHeight = 0;
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080090 }
Mathias Agopian759fdb22009-07-02 17:33:40 -070091 mSurface.clear();
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080092}
93
Mathias Agopian076b1cc2009-04-10 14:24:30 -070094sp<LayerBaseClient::Surface> Layer::createSurface() const
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080095{
96 return mSurface;
97}
98
Mathias Agopian9a112062009-04-17 19:36:26 -070099status_t Layer::ditch()
100{
Mathias Agopian0aa758d2009-04-22 15:23:34 -0700101 // the layer is not on screen anymore. free as much resources as possible
Mathias Agopian0aa758d2009-04-22 15:23:34 -0700102 destroy();
Mathias Agopian9a112062009-04-17 19:36:26 -0700103 return NO_ERROR;
104}
105
Mathias Agopianf9d93272009-06-19 17:00:27 -0700106status_t Layer::setBuffers( uint32_t w, uint32_t h,
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800107 PixelFormat format, uint32_t flags)
108{
109 PixelFormatInfo info;
110 status_t err = getPixelFormatInfo(format, &info);
111 if (err) return err;
112
Mathias Agopian076b1cc2009-04-10 14:24:30 -0700113 uint32_t bufferFlags = 0;
Mathias Agopian076b1cc2009-04-10 14:24:30 -0700114 if (flags & ISurfaceComposer::eSecure)
115 bufferFlags |= Buffer::SECURE;
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800116
Mathias Agopiancbb288b2009-09-07 16:32:45 -0700117 mFormat = format;
118 mWidth = w;
119 mHeight = h;
Mathias Agopian076b1cc2009-04-10 14:24:30 -0700120 mSecure = (bufferFlags & Buffer::SECURE) ? true : false;
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800121 mNeedsBlending = (info.h_alpha - info.l_alpha) > 0;
Mathias Agopiancbb288b2009-09-07 16:32:45 -0700122 mBufferFlags = bufferFlags;
123 for (size_t i=0 ; i<NUM_BUFFERS ; i++) {
124 mBuffers[i] = new Buffer();
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800125 }
Mathias Agopian9a112062009-04-17 19:36:26 -0700126 mSurface = new SurfaceLayer(mFlinger, clientIndex(), this);
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800127 return NO_ERROR;
128}
129
130void Layer::reloadTexture(const Region& dirty)
131{
Mathias Agopiancbb288b2009-09-07 16:32:45 -0700132 Mutex::Autolock _l(mLock);
133 sp<Buffer> buffer(getFrontBuffer());
Mathias Agopian0926f502009-05-04 14:17:04 -0700134 if (LIKELY(mFlags & DisplayHardware::DIRECT_TEXTURE)) {
Mathias Agopian076b1cc2009-04-10 14:24:30 -0700135 int index = mFrontBufferIndex;
136 if (LIKELY(!mTextures[index].dirty)) {
137 glBindTexture(GL_TEXTURE_2D, mTextures[index].name);
138 } else {
139 // we need to recreate the texture
140 EGLDisplay dpy(mFlinger->graphicPlane(0).getEGLDisplay());
141
142 // create the new texture name if needed
143 if (UNLIKELY(mTextures[index].name == -1U)) {
144 mTextures[index].name = createTexture();
145 } else {
146 glBindTexture(GL_TEXTURE_2D, mTextures[index].name);
147 }
148
149 // free the previous image
150 if (mTextures[index].image != EGL_NO_IMAGE_KHR) {
151 eglDestroyImageKHR(dpy, mTextures[index].image);
152 mTextures[index].image = EGL_NO_IMAGE_KHR;
153 }
154
155 // construct an EGL_NATIVE_BUFFER_ANDROID
156 android_native_buffer_t* clientBuf = buffer->getNativeBuffer();
157
158 // create the new EGLImageKHR
159 const EGLint attrs[] = {
160 EGL_IMAGE_PRESERVED_KHR, EGL_TRUE,
161 EGL_NONE, EGL_NONE
162 };
163 mTextures[index].image = eglCreateImageKHR(
164 dpy, EGL_NO_CONTEXT, EGL_NATIVE_BUFFER_ANDROID,
165 (EGLClientBuffer)clientBuf, attrs);
166
167 LOGE_IF(mTextures[index].image == EGL_NO_IMAGE_KHR,
168 "eglCreateImageKHR() failed. err=0x%4x",
169 eglGetError());
170
171 if (mTextures[index].image != EGL_NO_IMAGE_KHR) {
172 glEGLImageTargetTexture2DOES(GL_TEXTURE_2D,
173 (GLeglImageOES)mTextures[index].image);
174 GLint error = glGetError();
175 if (UNLIKELY(error != GL_NO_ERROR)) {
176 // this failed, for instance, because we don't support
177 // NPOT.
178 // FIXME: do something!
179 mFlags &= ~DisplayHardware::DIRECT_TEXTURE;
180 } else {
181 // Everything went okay!
Mathias Agopian1fed11c2009-06-23 18:08:22 -0700182 mTextures[index].dirty = false;
183 mTextures[index].width = clientBuf->width;
184 mTextures[index].height = clientBuf->height;
Mathias Agopian076b1cc2009-04-10 14:24:30 -0700185 }
186 }
187 }
188 } else {
189 GGLSurface t;
Mathias Agopian0926f502009-05-04 14:17:04 -0700190 status_t res = buffer->lock(&t, GRALLOC_USAGE_SW_READ_RARELY);
191 LOGE_IF(res, "error %d (%s) locking buffer %p",
192 res, strerror(res), buffer.get());
193 if (res == NO_ERROR) {
Mathias Agopian076b1cc2009-04-10 14:24:30 -0700194 if (UNLIKELY(mTextures[0].name == -1U)) {
195 mTextures[0].name = createTexture();
196 }
Mathias Agopian1fed11c2009-06-23 18:08:22 -0700197 loadTexture(&mTextures[0], mTextures[0].name, dirty, t);
Mathias Agopian0926f502009-05-04 14:17:04 -0700198 buffer->unlock();
Mathias Agopian076b1cc2009-04-10 14:24:30 -0700199 }
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800200 }
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800201}
202
203
204void Layer::onDraw(const Region& clip) const
205{
Mathias Agopian076b1cc2009-04-10 14:24:30 -0700206 const int index = (mFlags & DisplayHardware::DIRECT_TEXTURE) ?
207 mFrontBufferIndex : 0;
208 GLuint textureName = mTextures[index].name;
Mathias Agopian076b1cc2009-04-10 14:24:30 -0700209 if (UNLIKELY(textureName == -1LU)) {
Mathias Agopiancbb288b2009-09-07 16:32:45 -0700210 //LOGW("Layer %p doesn't have a texture", this);
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800211 // the texture has not been created yet, this Layer has
212 // in fact never been drawn into. this happens frequently with
213 // SurfaceView.
214 clearWithOpenGL(clip);
215 return;
216 }
Mathias Agopiancbb288b2009-09-07 16:32:45 -0700217
Mathias Agopian1fed11c2009-06-23 18:08:22 -0700218 drawWithOpenGL(clip, mTextures[index]);
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800219}
220
Mathias Agopiancbb288b2009-09-07 16:32:45 -0700221sp<SurfaceBuffer> Layer::requestBuffer(int index, int usage)
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800222{
Mathias Agopian48d819a2009-09-10 19:41:18 -0700223 sp<Buffer> buffer;
224
225 // this ensures our client doesn't go away while we're accessing
226 // the shared area.
227 sp<Client> ourClient(client.promote());
228 if (ourClient == 0) {
229 // oops, the client is already gone
230 return buffer;
231 }
232
Mathias Agopian076b1cc2009-04-10 14:24:30 -0700233 /*
Mathias Agopiancbb288b2009-09-07 16:32:45 -0700234 * This is called from the client's Surface::dequeue(). This can happen
235 * at any time, especially while we're in the middle of using the
236 * buffer 'index' as our front buffer.
Mathias Agopian076b1cc2009-04-10 14:24:30 -0700237 *
Mathias Agopiancbb288b2009-09-07 16:32:45 -0700238 * Make sure the buffer we're resizing is not the front buffer and has been
239 * dequeued. Once this condition is asserted, we are guaranteed that this
240 * buffer cannot become the front buffer under our feet, since we're called
241 * from Surface::dequeue()
Mathias Agopian076b1cc2009-04-10 14:24:30 -0700242 */
Mathias Agopiancbb288b2009-09-07 16:32:45 -0700243 status_t err = lcblk->assertReallocate(index);
244 LOGE_IF(err, "assertReallocate(%d) failed (%s)", index, strerror(-err));
Mathias Agopian48d819a2009-09-10 19:41:18 -0700245 if (err != NO_ERROR) {
246 // the surface may have died
247 return buffer;
248 }
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800249
Mathias Agopian48d819a2009-09-10 19:41:18 -0700250 uint32_t w, h;
251 { // scope for the lock
252 Mutex::Autolock _l(mLock);
253 w = mWidth;
254 h = mHeight;
255 buffer = mBuffers[index];
256 mBuffers[index].clear();
257 }
258
259
Mathias Agopiancbb288b2009-09-07 16:32:45 -0700260 if (buffer->getStrongCount() == 1) {
261 err = buffer->reallocate(w, h, mFormat, usage, mBufferFlags);
Mathias Agopian076b1cc2009-04-10 14:24:30 -0700262 } else {
Mathias Agopiancbb288b2009-09-07 16:32:45 -0700263 // here we have to reallocate a new buffer because we could have a
264 // client in our process with a reference to it (eg: status bar),
265 // and we can't release the handle under its feet.
266 buffer.clear();
267 buffer = new Buffer(w, h, mFormat, usage, mBufferFlags);
268 err = buffer->initCheck();
269 }
270
271 if (err || buffer->handle == 0) {
272 LOGE_IF(err || buffer->handle == 0,
273 "Layer::requestBuffer(this=%p), index=%d, w=%d, h=%d failed (%s)",
274 this, index, w, h, strerror(-err));
275 } else {
276 LOGD_IF(DEBUG_RESIZE,
277 "Layer::requestBuffer(this=%p), index=%d, w=%d, h=%d",
278 this, index, w, h);
279 }
280
281 if (err == NO_ERROR && buffer->handle != 0) {
Mathias Agopian48d819a2009-09-10 19:41:18 -0700282 Mutex::Autolock _l(mLock);
283 if (mWidth && mHeight) {
284 // and we have new buffer
285 mBuffers[index] = buffer;
286 // texture is now dirty...
287 mTextures[index].dirty = true;
288 } else {
289 // oops we got killed while we were allocating the buffer
290 buffer.clear();
291 }
Mathias Agopian076b1cc2009-04-10 14:24:30 -0700292 }
293 return buffer;
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800294}
295
296uint32_t Layer::doTransaction(uint32_t flags)
297{
298 const Layer::State& front(drawingState());
299 const Layer::State& temp(currentState());
300
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800301 // Index of the back buffer
302 const bool backbufferChanged = (front.w != temp.w) || (front.h != temp.h);
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800303
Mathias Agopiancbb288b2009-09-07 16:32:45 -0700304 if (backbufferChanged) {
305 // the size changed, we need to ask our client to request a new buffer
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800306 LOGD_IF(DEBUG_RESIZE,
Mathias Agopiancbb288b2009-09-07 16:32:45 -0700307 "resize (layer=%p), requested (%dx%d), "
308 "drawing (%d,%d), (%dx%d), (%dx%d)",
309 this, int(temp.w), int(temp.h),
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800310 int(drawingState().w), int(drawingState().h),
Mathias Agopiancbb288b2009-09-07 16:32:45 -0700311 int(mBuffers[0]->getWidth()), int(mBuffers[0]->getHeight()),
312 int(mBuffers[1]->getWidth()), int(mBuffers[1]->getHeight()));
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800313
Mathias Agopiancbb288b2009-09-07 16:32:45 -0700314 // record the new size, form this point on, when the client request a
315 // buffer, it'll get the new size.
316 setDrawingSize(temp.w, temp.h);
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800317
Mathias Agopiancbb288b2009-09-07 16:32:45 -0700318 // all buffers need reallocation
319 lcblk->reallocate();
320
321 // recompute the visible region
322 // FIXME: ideally we would do that only when we have received
323 // a buffer of the right size
324 flags |= Layer::eVisibleRegion;
325 this->contentDirty = true;
326
327#if 0
328 // FIXME: handle freeze lock
329 // we're being resized and there is a freeze display request,
330 // acquire a freeze lock, so that the screen stays put
331 // until we've redrawn at the new size; this is to avoid
332 // glitches upon orientation changes.
333 if (mFlinger->hasFreezeRequest()) {
334 // if the surface is hidden, don't try to acquire the
335 // freeze lock, since hidden surfaces may never redraw
336 if (!(front.flags & ISurfaceComposer::eLayerHidden)) {
337 mFreezeLock = mFlinger->getFreezeLock();
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800338 }
339 }
Mathias Agopiancbb288b2009-09-07 16:32:45 -0700340#endif
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800341 }
Mathias Agopiancbb288b2009-09-07 16:32:45 -0700342
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800343 if (temp.sequence != front.sequence) {
344 if (temp.flags & ISurfaceComposer::eLayerHidden || temp.alpha == 0) {
345 // this surface is now hidden, so it shouldn't hold a freeze lock
346 // (it may never redraw, which is fine if it is hidden)
347 mFreezeLock.clear();
348 }
349 }
350
351 return LayerBase::doTransaction(flags);
352}
353
Mathias Agopiancbb288b2009-09-07 16:32:45 -0700354void Layer::setDrawingSize(uint32_t w, uint32_t h) {
355 Mutex::Autolock _l(mLock);
356 mWidth = w;
357 mHeight = h;
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800358}
359
360// ----------------------------------------------------------------------------
361// pageflip handling...
362// ----------------------------------------------------------------------------
363
364void Layer::lockPageFlip(bool& recomputeVisibleRegions)
365{
Mathias Agopiancbb288b2009-09-07 16:32:45 -0700366 ssize_t buf = lcblk->retireAndLock();
367 if (buf < NO_ERROR) {
368 //LOGW("nothing to retire (%s)", strerror(-buf));
369 // NOTE: here the buffer is locked because we will used
370 // for composition later in the loop
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800371 return;
372 }
Mathias Agopian076b1cc2009-04-10 14:24:30 -0700373
Mathias Agopiancbb288b2009-09-07 16:32:45 -0700374 // we retired a buffer, which becomes the new front buffer
375 mFrontBufferIndex = buf;
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800376
Mathias Agopiancbb288b2009-09-07 16:32:45 -0700377 // get the dirty region
378 sp<Buffer> newFrontBuffer(getBuffer(buf));
379 const Region dirty(lcblk->getDirtyRegion(buf));
380 mPostedDirtyRegion = dirty.intersect( newFrontBuffer->getBounds() );
Mathias Agopian076b1cc2009-04-10 14:24:30 -0700381
Mathias Agopiancbb288b2009-09-07 16:32:45 -0700382 // FIXME: signal an event if we have more buffers waiting
383 // mFlinger->signalEvent();
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800384
Mathias Agopiancbb288b2009-09-07 16:32:45 -0700385 reloadTexture( mPostedDirtyRegion );
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800386}
387
388void Layer::unlockPageFlip(
389 const Transform& planeTransform, Region& outDirtyRegion)
390{
391 Region dirtyRegion(mPostedDirtyRegion);
392 if (!dirtyRegion.isEmpty()) {
393 mPostedDirtyRegion.clear();
394 // The dirty region is given in the layer's coordinate space
395 // transform the dirty region by the surface's transformation
396 // and the global transformation.
397 const Layer::State& s(drawingState());
398 const Transform tr(planeTransform * s.transform);
399 dirtyRegion = tr.transform(dirtyRegion);
400
401 // At this point, the dirty region is in screen space.
402 // Make sure it's constrained by the visible region (which
403 // is in screen space as well).
404 dirtyRegion.andSelf(visibleRegionScreen);
405 outDirtyRegion.orSelf(dirtyRegion);
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800406 }
407}
408
409void Layer::finishPageFlip()
410{
Mathias Agopiancbb288b2009-09-07 16:32:45 -0700411 status_t err = lcblk->unlock( mFrontBufferIndex );
412 LOGE_IF(err!=NO_ERROR,
413 "layer %p, buffer=%d wasn't locked!",
414 this, mFrontBufferIndex);
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800415}
416
Mathias Agopian076b1cc2009-04-10 14:24:30 -0700417// ---------------------------------------------------------------------------
418
Mathias Agopian9a112062009-04-17 19:36:26 -0700419Layer::SurfaceLayer::SurfaceLayer(const sp<SurfaceFlinger>& flinger,
420 SurfaceID id, const sp<Layer>& owner)
421 : Surface(flinger, id, owner->getIdentity(), owner)
422{
423}
424
425Layer::SurfaceLayer::~SurfaceLayer()
Mathias Agopian076b1cc2009-04-10 14:24:30 -0700426{
427}
428
Mathias Agopiancbb288b2009-09-07 16:32:45 -0700429sp<SurfaceBuffer> Layer::SurfaceLayer::requestBuffer(int index, int usage)
Mathias Agopian076b1cc2009-04-10 14:24:30 -0700430{
Mathias Agopiancbb288b2009-09-07 16:32:45 -0700431 sp<SurfaceBuffer> buffer;
Mathias Agopian076b1cc2009-04-10 14:24:30 -0700432 sp<Layer> owner(getOwner());
433 if (owner != 0) {
Mathias Agopiancbb288b2009-09-07 16:32:45 -0700434 LOGE_IF(uint32_t(index)>=NUM_BUFFERS,
435 "getBuffer() index (%d) out of range", index);
436 if (uint32_t(index) < NUM_BUFFERS) {
437 buffer = owner->requestBuffer(index, usage);
438 }
Mathias Agopian076b1cc2009-04-10 14:24:30 -0700439 }
440 return buffer;
441}
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800442
443// ---------------------------------------------------------------------------
444
445
446}; // namespace android