OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2010, Google Inc. All rights reserved. | 2 * Copyright (c) 2010, 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 void DrawingBuffer::freeRecycledMailboxes() | 201 void DrawingBuffer::freeRecycledMailboxes() |
202 { | 202 { |
203 if (m_recycledMailboxQueue.isEmpty()) | 203 if (m_recycledMailboxQueue.isEmpty()) |
204 return; | 204 return; |
205 while (!m_recycledMailboxQueue.isEmpty()) | 205 while (!m_recycledMailboxQueue.isEmpty()) |
206 deleteMailbox(m_recycledMailboxQueue.takeLast()); | 206 deleteMailbox(m_recycledMailboxQueue.takeLast()); |
207 } | 207 } |
208 | 208 |
209 bool DrawingBuffer::prepareMailbox(WebExternalTextureMailbox* outMailbox, WebExt
ernalBitmap* bitmap) | 209 bool DrawingBuffer::prepareMailbox(WebExternalTextureMailbox* outMailbox, WebExt
ernalBitmap* bitmap) |
210 { | 210 { |
211 ASSERT(!m_isHidden); | |
212 if (!m_contentsChanged) | |
213 return false; | |
214 | |
215 if (m_destructionInProgress) { | 211 if (m_destructionInProgress) { |
216 // It can be hit in the following sequence. | 212 // It can be hit in the following sequence. |
217 // 1. WebGL draws something. | 213 // 1. WebGL draws something. |
218 // 2. The compositor begins the frame. | 214 // 2. The compositor begins the frame. |
219 // 3. Javascript makes a context lost using WEBGL_lose_context extension
. | 215 // 3. Javascript makes a context lost using WEBGL_lose_context extension
. |
220 // 4. Here. | 216 // 4. Here. |
221 return false; | 217 return false; |
222 } | 218 } |
| 219 ASSERT(!m_isHidden); |
| 220 if (!m_contentsChanged) |
| 221 return false; |
223 | 222 |
224 // Resolve the multisampled buffer into m_colorBuffer texture. | 223 // Resolve the multisampled buffer into m_colorBuffer texture. |
225 if (m_multisampleMode != None) | 224 if (m_multisampleMode != None) |
226 commit(); | 225 commit(); |
227 | 226 |
228 if (bitmap) { | 227 if (bitmap) { |
229 bitmap->setSize(size()); | 228 bitmap->setSize(size()); |
230 | 229 |
231 unsigned char* pixels = bitmap->pixels(); | 230 unsigned char* pixels = bitmap->pixels(); |
232 bool needPremultiply = m_actualAttributes.alpha && !m_actualAttributes.p
remultipliedAlpha; | 231 bool needPremultiply = m_actualAttributes.alpha && !m_actualAttributes.p
remultipliedAlpha; |
(...skipping 814 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1047 void DrawingBuffer::deleteChromiumImageForTexture(TextureInfo* info) | 1046 void DrawingBuffer::deleteChromiumImageForTexture(TextureInfo* info) |
1048 { | 1047 { |
1049 if (info->imageId) { | 1048 if (info->imageId) { |
1050 m_context->releaseTexImage2DCHROMIUM(GL_TEXTURE_2D, info->imageId); | 1049 m_context->releaseTexImage2DCHROMIUM(GL_TEXTURE_2D, info->imageId); |
1051 m_context->destroyImageCHROMIUM(info->imageId); | 1050 m_context->destroyImageCHROMIUM(info->imageId); |
1052 info->imageId = 0; | 1051 info->imageId = 0; |
1053 } | 1052 } |
1054 } | 1053 } |
1055 | 1054 |
1056 } // namespace blink | 1055 } // namespace blink |
OLD | NEW |