blob: 3c3b919f079baea6c51ee4b6dcf1ea441215dcbc [file] [log] [blame]
Jeff Brown5541de92011-04-11 11:54:25 -07001/*
2 * Copyright (C) 2011 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 "Sprites"
18
19//#define LOG_NDEBUG 0
20
21#include "SpriteController.h"
22
23#include <cutils/log.h>
24#include <utils/String8.h>
Mathias Agopian52800612013-02-14 17:11:20 -080025#include <gui/Surface.h>
Jeff Brown5541de92011-04-11 11:54:25 -070026
27#include <SkBitmap.h>
28#include <SkCanvas.h>
29#include <SkColor.h>
30#include <SkPaint.h>
31#include <SkXfermode.h>
Mathias Agopian52800612013-02-14 17:11:20 -080032#include <android/native_window.h>
Jeff Brown5541de92011-04-11 11:54:25 -070033
34namespace android {
35
36// --- SpriteController ---
37
38SpriteController::SpriteController(const sp<Looper>& looper, int32_t overlayLayer) :
39 mLooper(looper), mOverlayLayer(overlayLayer) {
40 mHandler = new WeakMessageHandler(this);
Jeff Brown2352b972011-04-12 22:39:53 -070041
42 mLocked.transactionNestingCount = 0;
43 mLocked.deferredSpriteUpdate = false;
Jeff Brown5541de92011-04-11 11:54:25 -070044}
45
46SpriteController::~SpriteController() {
47 mLooper->removeMessages(mHandler);
48
49 if (mSurfaceComposerClient != NULL) {
50 mSurfaceComposerClient->dispose();
51 mSurfaceComposerClient.clear();
52 }
53}
54
55sp<Sprite> SpriteController::createSprite() {
56 return new SpriteImpl(this);
57}
58
Jeff Brown2352b972011-04-12 22:39:53 -070059void SpriteController::openTransaction() {
60 AutoMutex _l(mLock);
61
62 mLocked.transactionNestingCount += 1;
63}
64
65void SpriteController::closeTransaction() {
66 AutoMutex _l(mLock);
67
68 LOG_ALWAYS_FATAL_IF(mLocked.transactionNestingCount == 0,
69 "Sprite closeTransaction() called but there is no open sprite transaction");
70
71 mLocked.transactionNestingCount -= 1;
72 if (mLocked.transactionNestingCount == 0 && mLocked.deferredSpriteUpdate) {
73 mLocked.deferredSpriteUpdate = false;
Jeff Brown5541de92011-04-11 11:54:25 -070074 mLooper->sendMessage(mHandler, Message(MSG_UPDATE_SPRITES));
75 }
76}
77
Jeff Brown2352b972011-04-12 22:39:53 -070078void SpriteController::invalidateSpriteLocked(const sp<SpriteImpl>& sprite) {
79 bool wasEmpty = mLocked.invalidatedSprites.isEmpty();
80 mLocked.invalidatedSprites.push(sprite);
81 if (wasEmpty) {
82 if (mLocked.transactionNestingCount != 0) {
83 mLocked.deferredSpriteUpdate = true;
84 } else {
85 mLooper->sendMessage(mHandler, Message(MSG_UPDATE_SPRITES));
86 }
87 }
88}
89
Jeff Brown5541de92011-04-11 11:54:25 -070090void SpriteController::disposeSurfaceLocked(const sp<SurfaceControl>& surfaceControl) {
Jeff Brown2352b972011-04-12 22:39:53 -070091 bool wasEmpty = mLocked.disposedSurfaces.isEmpty();
92 mLocked.disposedSurfaces.push(surfaceControl);
Jeff Brown5541de92011-04-11 11:54:25 -070093 if (wasEmpty) {
94 mLooper->sendMessage(mHandler, Message(MSG_DISPOSE_SURFACES));
95 }
96}
97
98void SpriteController::handleMessage(const Message& message) {
99 switch (message.what) {
100 case MSG_UPDATE_SPRITES:
101 doUpdateSprites();
102 break;
103 case MSG_DISPOSE_SURFACES:
104 doDisposeSurfaces();
105 break;
106 }
107}
108
109void SpriteController::doUpdateSprites() {
110 // Collect information about sprite updates.
111 // Each sprite update record includes a reference to its associated sprite so we can
112 // be certain the sprites will not be deleted while this function runs. Sprites
113 // may invalidate themselves again during this time but we will handle those changes
114 // in the next iteration.
115 Vector<SpriteUpdate> updates;
116 size_t numSprites;
117 { // acquire lock
118 AutoMutex _l(mLock);
119
Jeff Brown2352b972011-04-12 22:39:53 -0700120 numSprites = mLocked.invalidatedSprites.size();
Jeff Brown5541de92011-04-11 11:54:25 -0700121 for (size_t i = 0; i < numSprites; i++) {
Jeff Brown2352b972011-04-12 22:39:53 -0700122 const sp<SpriteImpl>& sprite = mLocked.invalidatedSprites.itemAt(i);
Jeff Brown5541de92011-04-11 11:54:25 -0700123
124 updates.push(SpriteUpdate(sprite, sprite->getStateLocked()));
125 sprite->resetDirtyLocked();
126 }
Jeff Brown2352b972011-04-12 22:39:53 -0700127 mLocked.invalidatedSprites.clear();
Jeff Brown5541de92011-04-11 11:54:25 -0700128 } // release lock
129
130 // Create missing surfaces.
131 bool surfaceChanged = false;
132 for (size_t i = 0; i < numSprites; i++) {
133 SpriteUpdate& update = updates.editItemAt(i);
134
135 if (update.state.surfaceControl == NULL && update.state.wantSurfaceVisible()) {
Jeff Brown2352b972011-04-12 22:39:53 -0700136 update.state.surfaceWidth = update.state.icon.bitmap.width();
137 update.state.surfaceHeight = update.state.icon.bitmap.height();
Jeff Brown5541de92011-04-11 11:54:25 -0700138 update.state.surfaceDrawn = false;
139 update.state.surfaceVisible = false;
140 update.state.surfaceControl = obtainSurface(
141 update.state.surfaceWidth, update.state.surfaceHeight);
142 if (update.state.surfaceControl != NULL) {
143 update.surfaceChanged = surfaceChanged = true;
144 }
145 }
146 }
147
148 // Resize sprites if needed, inside a global transaction.
149 bool haveGlobalTransaction = false;
150 for (size_t i = 0; i < numSprites; i++) {
151 SpriteUpdate& update = updates.editItemAt(i);
152
153 if (update.state.surfaceControl != NULL && update.state.wantSurfaceVisible()) {
Jeff Brown2352b972011-04-12 22:39:53 -0700154 int32_t desiredWidth = update.state.icon.bitmap.width();
155 int32_t desiredHeight = update.state.icon.bitmap.height();
Jeff Brown5541de92011-04-11 11:54:25 -0700156 if (update.state.surfaceWidth < desiredWidth
157 || update.state.surfaceHeight < desiredHeight) {
158 if (!haveGlobalTransaction) {
159 SurfaceComposerClient::openGlobalTransaction();
160 haveGlobalTransaction = true;
161 }
162
163 status_t status = update.state.surfaceControl->setSize(desiredWidth, desiredHeight);
164 if (status) {
Steve Block3762c312012-01-06 19:20:56 +0000165 ALOGE("Error %d resizing sprite surface from %dx%d to %dx%d",
Jeff Brown5541de92011-04-11 11:54:25 -0700166 status, update.state.surfaceWidth, update.state.surfaceHeight,
167 desiredWidth, desiredHeight);
168 } else {
169 update.state.surfaceWidth = desiredWidth;
170 update.state.surfaceHeight = desiredHeight;
171 update.state.surfaceDrawn = false;
172 update.surfaceChanged = surfaceChanged = true;
173
174 if (update.state.surfaceVisible) {
175 status = update.state.surfaceControl->hide();
176 if (status) {
Steve Block3762c312012-01-06 19:20:56 +0000177 ALOGE("Error %d hiding sprite surface after resize.", status);
Jeff Brown5541de92011-04-11 11:54:25 -0700178 } else {
179 update.state.surfaceVisible = false;
180 }
181 }
182 }
183 }
184 }
185 }
186 if (haveGlobalTransaction) {
187 SurfaceComposerClient::closeGlobalTransaction();
188 }
189
190 // Redraw sprites if needed.
191 for (size_t i = 0; i < numSprites; i++) {
192 SpriteUpdate& update = updates.editItemAt(i);
193
194 if ((update.state.dirty & DIRTY_BITMAP) && update.state.surfaceDrawn) {
195 update.state.surfaceDrawn = false;
196 update.surfaceChanged = surfaceChanged = true;
197 }
198
199 if (update.state.surfaceControl != NULL && !update.state.surfaceDrawn
200 && update.state.wantSurfaceVisible()) {
201 sp<Surface> surface = update.state.surfaceControl->getSurface();
Mathias Agopian52800612013-02-14 17:11:20 -0800202 ANativeWindow_Buffer outBuffer;
203 status_t status = surface->lock(&outBuffer, NULL);
Jeff Brown5541de92011-04-11 11:54:25 -0700204 if (status) {
Steve Block3762c312012-01-06 19:20:56 +0000205 ALOGE("Error %d locking sprite surface before drawing.", status);
Jeff Brown5541de92011-04-11 11:54:25 -0700206 } else {
207 SkBitmap surfaceBitmap;
Mathias Agopian52800612013-02-14 17:11:20 -0800208 ssize_t bpr = outBuffer.stride * bytesPerPixel(outBuffer.format);
Jeff Brown5541de92011-04-11 11:54:25 -0700209 surfaceBitmap.setConfig(SkBitmap::kARGB_8888_Config,
Mathias Agopian52800612013-02-14 17:11:20 -0800210 outBuffer.width, outBuffer.height, bpr);
211 surfaceBitmap.setPixels(outBuffer.bits);
Jeff Brown5541de92011-04-11 11:54:25 -0700212
Chris Craik7c1a49f2013-02-13 10:25:12 -0800213 SkCanvas surfaceCanvas;
214 surfaceCanvas.setBitmapDevice(surfaceBitmap);
Jeff Brown5541de92011-04-11 11:54:25 -0700215
216 SkPaint paint;
217 paint.setXfermodeMode(SkXfermode::kSrc_Mode);
Jeff Brown2352b972011-04-12 22:39:53 -0700218 surfaceCanvas.drawBitmap(update.state.icon.bitmap, 0, 0, &paint);
Jeff Brown5541de92011-04-11 11:54:25 -0700219
Mathias Agopian52800612013-02-14 17:11:20 -0800220 if (outBuffer.width > uint32_t(update.state.icon.bitmap.width())) {
Jeff Brown5541de92011-04-11 11:54:25 -0700221 paint.setColor(0); // transparent fill color
Jeff Brown2352b972011-04-12 22:39:53 -0700222 surfaceCanvas.drawRectCoords(update.state.icon.bitmap.width(), 0,
Mathias Agopian52800612013-02-14 17:11:20 -0800223 outBuffer.width, update.state.icon.bitmap.height(), paint);
Jeff Brown5541de92011-04-11 11:54:25 -0700224 }
Mathias Agopian52800612013-02-14 17:11:20 -0800225 if (outBuffer.height > uint32_t(update.state.icon.bitmap.height())) {
Jeff Brown5541de92011-04-11 11:54:25 -0700226 paint.setColor(0); // transparent fill color
Jeff Brown2352b972011-04-12 22:39:53 -0700227 surfaceCanvas.drawRectCoords(0, update.state.icon.bitmap.height(),
Mathias Agopian52800612013-02-14 17:11:20 -0800228 outBuffer.width, outBuffer.height, paint);
Jeff Brown5541de92011-04-11 11:54:25 -0700229 }
230
231 status = surface->unlockAndPost();
232 if (status) {
Steve Block3762c312012-01-06 19:20:56 +0000233 ALOGE("Error %d unlocking and posting sprite surface after drawing.", status);
Jeff Brown5541de92011-04-11 11:54:25 -0700234 } else {
235 update.state.surfaceDrawn = true;
236 update.surfaceChanged = surfaceChanged = true;
237 }
238 }
239 }
240 }
241
242 // Set sprite surface properties and make them visible.
243 bool haveTransaction = false;
244 for (size_t i = 0; i < numSprites; i++) {
245 SpriteUpdate& update = updates.editItemAt(i);
246
247 bool wantSurfaceVisibleAndDrawn = update.state.wantSurfaceVisible()
248 && update.state.surfaceDrawn;
249 bool becomingVisible = wantSurfaceVisibleAndDrawn && !update.state.surfaceVisible;
250 bool becomingHidden = !wantSurfaceVisibleAndDrawn && update.state.surfaceVisible;
251 if (update.state.surfaceControl != NULL && (becomingVisible || becomingHidden
252 || (wantSurfaceVisibleAndDrawn && (update.state.dirty & (DIRTY_ALPHA
253 | DIRTY_POSITION | DIRTY_TRANSFORMATION_MATRIX | DIRTY_LAYER
254 | DIRTY_VISIBILITY | DIRTY_HOTSPOT))))) {
255 status_t status;
256 if (!haveTransaction) {
Mathias Agopian439863f2011-06-28 19:09:31 -0700257 SurfaceComposerClient::openGlobalTransaction();
Jeff Brown5541de92011-04-11 11:54:25 -0700258 haveTransaction = true;
259 }
260
261 if (wantSurfaceVisibleAndDrawn
262 && (becomingVisible || (update.state.dirty & DIRTY_ALPHA))) {
263 status = update.state.surfaceControl->setAlpha(update.state.alpha);
264 if (status) {
Steve Block3762c312012-01-06 19:20:56 +0000265 ALOGE("Error %d setting sprite surface alpha.", status);
Jeff Brown5541de92011-04-11 11:54:25 -0700266 }
267 }
268
269 if (wantSurfaceVisibleAndDrawn
270 && (becomingVisible || (update.state.dirty & (DIRTY_POSITION
271 | DIRTY_HOTSPOT)))) {
272 status = update.state.surfaceControl->setPosition(
Jeff Brown2352b972011-04-12 22:39:53 -0700273 update.state.positionX - update.state.icon.hotSpotX,
274 update.state.positionY - update.state.icon.hotSpotY);
Jeff Brown5541de92011-04-11 11:54:25 -0700275 if (status) {
Steve Block3762c312012-01-06 19:20:56 +0000276 ALOGE("Error %d setting sprite surface position.", status);
Jeff Brown5541de92011-04-11 11:54:25 -0700277 }
278 }
279
280 if (wantSurfaceVisibleAndDrawn
281 && (becomingVisible
282 || (update.state.dirty & DIRTY_TRANSFORMATION_MATRIX))) {
283 status = update.state.surfaceControl->setMatrix(
284 update.state.transformationMatrix.dsdx,
285 update.state.transformationMatrix.dtdx,
286 update.state.transformationMatrix.dsdy,
287 update.state.transformationMatrix.dtdy);
288 if (status) {
Steve Block3762c312012-01-06 19:20:56 +0000289 ALOGE("Error %d setting sprite surface transformation matrix.", status);
Jeff Brown5541de92011-04-11 11:54:25 -0700290 }
291 }
292
293 int32_t surfaceLayer = mOverlayLayer + update.state.layer;
294 if (wantSurfaceVisibleAndDrawn
295 && (becomingVisible || (update.state.dirty & DIRTY_LAYER))) {
296 status = update.state.surfaceControl->setLayer(surfaceLayer);
297 if (status) {
Steve Block3762c312012-01-06 19:20:56 +0000298 ALOGE("Error %d setting sprite surface layer.", status);
Jeff Brown5541de92011-04-11 11:54:25 -0700299 }
300 }
301
302 if (becomingVisible) {
Jeff Brown4fd42e52012-08-26 22:49:01 -0700303 status = update.state.surfaceControl->show();
Jeff Brown5541de92011-04-11 11:54:25 -0700304 if (status) {
Steve Block3762c312012-01-06 19:20:56 +0000305 ALOGE("Error %d showing sprite surface.", status);
Jeff Brown5541de92011-04-11 11:54:25 -0700306 } else {
307 update.state.surfaceVisible = true;
308 update.surfaceChanged = surfaceChanged = true;
309 }
310 } else if (becomingHidden) {
311 status = update.state.surfaceControl->hide();
312 if (status) {
Steve Block3762c312012-01-06 19:20:56 +0000313 ALOGE("Error %d hiding sprite surface.", status);
Jeff Brown5541de92011-04-11 11:54:25 -0700314 } else {
315 update.state.surfaceVisible = false;
316 update.surfaceChanged = surfaceChanged = true;
317 }
318 }
319 }
320 }
321
322 if (haveTransaction) {
Mathias Agopian439863f2011-06-28 19:09:31 -0700323 SurfaceComposerClient::closeGlobalTransaction();
Jeff Brown5541de92011-04-11 11:54:25 -0700324 }
325
326 // If any surfaces were changed, write back the new surface properties to the sprites.
327 if (surfaceChanged) { // acquire lock
328 AutoMutex _l(mLock);
329
330 for (size_t i = 0; i < numSprites; i++) {
331 const SpriteUpdate& update = updates.itemAt(i);
332
333 if (update.surfaceChanged) {
334 update.sprite->setSurfaceLocked(update.state.surfaceControl,
335 update.state.surfaceWidth, update.state.surfaceHeight,
336 update.state.surfaceDrawn, update.state.surfaceVisible);
337 }
338 }
339 } // release lock
340
341 // Clear the sprite update vector outside the lock. It is very important that
342 // we do not clear sprite references inside the lock since we could be releasing
343 // the last remaining reference to the sprite here which would result in the
344 // sprite being deleted and the lock being reacquired by the sprite destructor
345 // while already held.
346 updates.clear();
347}
348
349void SpriteController::doDisposeSurfaces() {
350 // Collect disposed surfaces.
351 Vector<sp<SurfaceControl> > disposedSurfaces;
352 { // acquire lock
Jeff Brown2352b972011-04-12 22:39:53 -0700353 AutoMutex _l(mLock);
354
355 disposedSurfaces = mLocked.disposedSurfaces;
356 mLocked.disposedSurfaces.clear();
Jeff Brown5541de92011-04-11 11:54:25 -0700357 } // release lock
358
359 // Release the last reference to each surface outside of the lock.
360 // We don't want the surfaces to be deleted while we are holding our lock.
361 disposedSurfaces.clear();
362}
363
364void SpriteController::ensureSurfaceComposerClient() {
365 if (mSurfaceComposerClient == NULL) {
366 mSurfaceComposerClient = new SurfaceComposerClient();
367 }
368}
369
370sp<SurfaceControl> SpriteController::obtainSurface(int32_t width, int32_t height) {
371 ensureSurfaceComposerClient();
372
373 sp<SurfaceControl> surfaceControl = mSurfaceComposerClient->createSurface(
Jeff Brown64a55af2012-08-26 02:47:39 -0700374 String8("Sprite"), width, height, PIXEL_FORMAT_RGBA_8888,
375 ISurfaceComposerClient::eHidden);
Mathias Agopian52800612013-02-14 17:11:20 -0800376 if (surfaceControl == NULL || !surfaceControl->isValid()) {
Steve Block3762c312012-01-06 19:20:56 +0000377 ALOGE("Error creating sprite surface.");
Jeff Brown5541de92011-04-11 11:54:25 -0700378 return NULL;
379 }
380 return surfaceControl;
381}
382
383
384// --- SpriteController::SpriteImpl ---
385
386SpriteController::SpriteImpl::SpriteImpl(const sp<SpriteController> controller) :
Jeff Brown2352b972011-04-12 22:39:53 -0700387 mController(controller) {
Jeff Brown5541de92011-04-11 11:54:25 -0700388}
389
390SpriteController::SpriteImpl::~SpriteImpl() {
391 AutoMutex _m(mController->mLock);
392
393 // Let the controller take care of deleting the last reference to sprite
394 // surfaces so that we do not block the caller on an IPC here.
Jeff Brown2352b972011-04-12 22:39:53 -0700395 if (mLocked.state.surfaceControl != NULL) {
396 mController->disposeSurfaceLocked(mLocked.state.surfaceControl);
397 mLocked.state.surfaceControl.clear();
Jeff Brown5541de92011-04-11 11:54:25 -0700398 }
399}
400
Jeff Brown2352b972011-04-12 22:39:53 -0700401void SpriteController::SpriteImpl::setIcon(const SpriteIcon& icon) {
Jeff Brown5541de92011-04-11 11:54:25 -0700402 AutoMutex _l(mController->mLock);
403
Jeff Brown2352b972011-04-12 22:39:53 -0700404 uint32_t dirty;
405 if (icon.isValid()) {
406 icon.bitmap.copyTo(&mLocked.state.icon.bitmap, SkBitmap::kARGB_8888_Config);
Jeff Brown5541de92011-04-11 11:54:25 -0700407
Jeff Brown2352b972011-04-12 22:39:53 -0700408 if (!mLocked.state.icon.isValid()
409 || mLocked.state.icon.hotSpotX != icon.hotSpotX
410 || mLocked.state.icon.hotSpotY != icon.hotSpotY) {
411 mLocked.state.icon.hotSpotX = icon.hotSpotX;
412 mLocked.state.icon.hotSpotY = icon.hotSpotY;
413 dirty = DIRTY_BITMAP | DIRTY_HOTSPOT;
414 } else {
415 dirty = DIRTY_BITMAP;
416 }
417 } else if (mLocked.state.icon.isValid()) {
418 mLocked.state.icon.bitmap.reset();
419 dirty = DIRTY_BITMAP | DIRTY_HOTSPOT;
420 } else {
421 return; // setting to invalid icon and already invalid so nothing to do
Jeff Brown5541de92011-04-11 11:54:25 -0700422 }
423
424 invalidateLocked(dirty);
425}
426
427void SpriteController::SpriteImpl::setVisible(bool visible) {
428 AutoMutex _l(mController->mLock);
429
Jeff Brown2352b972011-04-12 22:39:53 -0700430 if (mLocked.state.visible != visible) {
431 mLocked.state.visible = visible;
Jeff Brown5541de92011-04-11 11:54:25 -0700432 invalidateLocked(DIRTY_VISIBILITY);
433 }
434}
435
436void SpriteController::SpriteImpl::setPosition(float x, float y) {
437 AutoMutex _l(mController->mLock);
438
Jeff Brown2352b972011-04-12 22:39:53 -0700439 if (mLocked.state.positionX != x || mLocked.state.positionY != y) {
440 mLocked.state.positionX = x;
441 mLocked.state.positionY = y;
Jeff Brown5541de92011-04-11 11:54:25 -0700442 invalidateLocked(DIRTY_POSITION);
443 }
444}
445
446void SpriteController::SpriteImpl::setLayer(int32_t layer) {
447 AutoMutex _l(mController->mLock);
448
Jeff Brown2352b972011-04-12 22:39:53 -0700449 if (mLocked.state.layer != layer) {
450 mLocked.state.layer = layer;
Jeff Brown5541de92011-04-11 11:54:25 -0700451 invalidateLocked(DIRTY_LAYER);
452 }
453}
454
455void SpriteController::SpriteImpl::setAlpha(float alpha) {
456 AutoMutex _l(mController->mLock);
457
Jeff Brown2352b972011-04-12 22:39:53 -0700458 if (mLocked.state.alpha != alpha) {
459 mLocked.state.alpha = alpha;
Jeff Brown5541de92011-04-11 11:54:25 -0700460 invalidateLocked(DIRTY_ALPHA);
461 }
462}
463
464void SpriteController::SpriteImpl::setTransformationMatrix(
465 const SpriteTransformationMatrix& matrix) {
466 AutoMutex _l(mController->mLock);
467
Jeff Brown2352b972011-04-12 22:39:53 -0700468 if (mLocked.state.transformationMatrix != matrix) {
469 mLocked.state.transformationMatrix = matrix;
Jeff Brown5541de92011-04-11 11:54:25 -0700470 invalidateLocked(DIRTY_TRANSFORMATION_MATRIX);
471 }
472}
473
Jeff Brown5541de92011-04-11 11:54:25 -0700474void SpriteController::SpriteImpl::invalidateLocked(uint32_t dirty) {
Jeff Brown2352b972011-04-12 22:39:53 -0700475 bool wasDirty = mLocked.state.dirty;
476 mLocked.state.dirty |= dirty;
477
478 if (!wasDirty) {
479 mController->invalidateSpriteLocked(this);
Jeff Brown5541de92011-04-11 11:54:25 -0700480 }
481}
482
483} // namespace android