Lines Matching defs:update
111 // Each sprite update record includes a reference to its associated sprite so we can
133 SpriteUpdate& update = updates.editItemAt(i);
135 if (update.state.surfaceControl == NULL && update.state.wantSurfaceVisible()) {
136 update.state.surfaceWidth = update.state.icon.bitmap.width();
137 update.state.surfaceHeight = update.state.icon.bitmap.height();
138 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;
151 SpriteUpdate& update = updates.editItemAt(i);
153 if (update.state.surfaceControl != NULL && update.state.wantSurfaceVisible()) {
154 int32_t desiredWidth = update.state.icon.bitmap.width();
155 int32_t desiredHeight = update.state.icon.bitmap.height();
156 if (update.state.surfaceWidth < desiredWidth
157 || update.state.surfaceHeight < desiredHeight) {
163 status_t status = update.state.surfaceControl->setSize(desiredWidth, desiredHeight);
166 status, update.state.surfaceWidth, update.state.surfaceHeight,
169 update.state.surfaceWidth = desiredWidth;
170 update.state.surfaceHeight = desiredHeight;
171 update.state.surfaceDrawn = false;
172 update.surfaceChanged = surfaceChanged = true;
174 if (update.state.surfaceVisible) {
175 status = update.state.surfaceControl->hide();
179 update.state.surfaceVisible = false;
192 SpriteUpdate& update = updates.editItemAt(i);
194 if ((update.state.dirty & DIRTY_BITMAP) && update.state.surfaceDrawn) {
195 update.state.surfaceDrawn = false;
196 update.surfaceChanged = surfaceChanged = true;
199 if (update.state.surfaceControl != NULL && !update.state.surfaceDrawn
200 && update.state.wantSurfaceVisible()) {
201 sp<Surface> surface = update.state.surfaceControl->getSurface();
216 surfaceCanvas.drawBitmap(update.state.icon.bitmap, 0, 0, &paint);
218 if (outBuffer.width > update.state.icon.bitmap.width()) {
220 surfaceCanvas.drawRectCoords(update.state.icon.bitmap.width(), 0,
221 outBuffer.width, update.state.icon.bitmap.height(), paint);
223 if (outBuffer.height > update.state.icon.bitmap.height()) {
225 surfaceCanvas.drawRectCoords(0, update.state.icon.bitmap.height(),
233 update.state.surfaceDrawn = true;
234 update.surfaceChanged = surfaceChanged = true;
243 SpriteUpdate& update = updates.editItemAt(i);
245 bool wantSurfaceVisibleAndDrawn = update.state.wantSurfaceVisible()
246 && update.state.surfaceDrawn;
247 bool becomingVisible = wantSurfaceVisibleAndDrawn && !update.state.surfaceVisible;
248 bool becomingHidden = !wantSurfaceVisibleAndDrawn && update.state.surfaceVisible;
249 if (update.state.surfaceControl != NULL && (becomingVisible || becomingHidden
250 || (wantSurfaceVisibleAndDrawn && (update.state.dirty & (DIRTY_ALPHA
260 && (becomingVisible || (update.state.dirty & DIRTY_ALPHA))) {
261 status = update.state.surfaceControl->setAlpha(update.state.alpha);
268 && (becomingVisible || (update.state.dirty & (DIRTY_POSITION
270 status = update.state.surfaceControl->setPosition(
271 update.state.positionX - update.state.icon.hotSpotX,
272 update.state.positionY - update.state.icon.hotSpotY);
280 || (update.state.dirty & DIRTY_TRANSFORMATION_MATRIX))) {
281 status = update.state.surfaceControl->setMatrix(
282 update.state.transformationMatrix.dsdx,
283 update.state.transformationMatrix.dtdx,
284 update.state.transformationMatrix.dsdy,
285 update.state.transformationMatrix.dtdy);
291 int32_t surfaceLayer = mOverlayLayer + update.state.layer;
293 && (becomingVisible || (update.state.dirty & DIRTY_LAYER))) {
294 status = update.state.surfaceControl->setLayer(surfaceLayer);
301 status = update.state.surfaceControl->show();
305 update.state.surfaceVisible = true;
306 update.surfaceChanged = surfaceChanged = true;
309 status = update.state.surfaceControl->hide();
313 update.state.surfaceVisible = false;
314 update.surfaceChanged = surfaceChanged = true;
329 const SpriteUpdate& update = updates.itemAt(i);
331 if (update.surfaceChanged) {
332 update.sprite->setSurfaceLocked(update.state.surfaceControl,
333 update.state.surfaceWidth, update.state.surfaceHeight,
334 update.state.surfaceDrawn, update.state.surfaceVisible);
339 // Clear the sprite update vector outside the lock. It is very important that