OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
421 | 421 |
422 // Due to borders, when the paint rect is extended to tile boundaries, it | 422 // Due to borders, when the paint rect is extended to tile boundaries, it |
423 // may end up overlapping more tiles than the original content rect. Record | 423 // may end up overlapping more tiles than the original content rect. Record |
424 // that original rect so we don't upload more tiles than necessary. | 424 // that original rect so we don't upload more tiles than necessary. |
425 m_updateRect = contentRect; | 425 m_updateRect = contentRect; |
426 | 426 |
427 m_paintRect = m_tiler->layerRectToContentRect(dirtyLayerRect); | 427 m_paintRect = m_tiler->layerRectToContentRect(dirtyLayerRect); |
428 if (dirtyLayerRect.isEmpty()) | 428 if (dirtyLayerRect.isEmpty()) |
429 return; | 429 return; |
430 | 430 |
| 431 // Calling prepareToUpdate() calls into WebKit to paint, which may have the
side |
| 432 // effect of disabling compositing, which causes our reference to the textur
e updater to be deleted. |
| 433 // However, we can't free the memory backing the GraphicsContext until the p
aint finishes, |
| 434 // so we grab a local reference here to hold the updater alive until the pai
nt completes. |
| 435 RefPtr<LayerTextureUpdater> protector(textureUpdater()); |
431 textureUpdater()->prepareToUpdate(m_paintRect, m_tiler->tileSize(), m_tiler-
>hasBorderTexels()); | 436 textureUpdater()->prepareToUpdate(m_paintRect, m_tiler->tileSize(), m_tiler-
>hasBorderTexels()); |
432 } | 437 } |
433 | 438 |
434 } | 439 } |
435 #endif // USE(ACCELERATED_COMPOSITING) | 440 #endif // USE(ACCELERATED_COMPOSITING) |
OLD | NEW |