| 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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 m_layerComposited = true; | 184 m_layerComposited = true; |
| 185 } | 185 } |
| 186 | 186 |
| 187 blink::WebGraphicsContext3D* DrawingBuffer::context() | 187 blink::WebGraphicsContext3D* DrawingBuffer::context() |
| 188 { | 188 { |
| 189 return m_context.get(); | 189 return m_context.get(); |
| 190 } | 190 } |
| 191 | 191 |
| 192 bool DrawingBuffer::prepareMailbox(blink::WebExternalTextureMailbox* outMailbox,
blink::WebExternalBitmap* bitmap) | 192 bool DrawingBuffer::prepareMailbox(blink::WebExternalTextureMailbox* outMailbox,
blink::WebExternalBitmap* bitmap) |
| 193 { | 193 { |
| 194 // prepareMailbox() is always called after layout. | |
| 195 ASSERT(!m_destructionInProgress); | |
| 196 | |
| 197 if (!m_contentsChanged) | 194 if (!m_contentsChanged) |
| 198 return false; | 195 return false; |
| 199 | 196 |
| 197 if (m_destructionInProgress) { |
| 198 // It can be hit in the following sequence. |
| 199 // 1. WebGL draws something. |
| 200 // 2. The compositor begins the frame. |
| 201 // 3. Javascript makes a context lost using WEBGL_lose_context extension
. |
| 202 // 4. Here. |
| 203 return false; |
| 204 } |
| 205 |
| 200 m_context->makeContextCurrent(); | 206 m_context->makeContextCurrent(); |
| 201 | 207 |
| 202 // Resolve the multisampled buffer into m_colorBuffer texture. | 208 // Resolve the multisampled buffer into m_colorBuffer texture. |
| 203 if (m_multisampleMode != None) | 209 if (m_multisampleMode != None) |
| 204 commit(); | 210 commit(); |
| 205 | 211 |
| 206 if (bitmap) { | 212 if (bitmap) { |
| 207 bitmap->setSize(size()); | 213 bitmap->setSize(size()); |
| 208 | 214 |
| 209 unsigned char* pixels = bitmap->pixels(); | 215 unsigned char* pixels = bitmap->pixels(); |
| (...skipping 796 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1006 } | 1012 } |
| 1007 } | 1013 } |
| 1008 | 1014 |
| 1009 void DrawingBuffer::texImage2DResourceSafe(GLenum target, GLint level, GLenum in
ternalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum
type, GLint unpackAlignment) | 1015 void DrawingBuffer::texImage2DResourceSafe(GLenum target, GLint level, GLenum in
ternalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum
type, GLint unpackAlignment) |
| 1010 { | 1016 { |
| 1011 ASSERT(unpackAlignment == 1 || unpackAlignment == 2 || unpackAlignment == 4
|| unpackAlignment == 8); | 1017 ASSERT(unpackAlignment == 1 || unpackAlignment == 2 || unpackAlignment == 4
|| unpackAlignment == 8); |
| 1012 m_context->texImage2D(target, level, internalformat, width, height, border,
format, type, 0); | 1018 m_context->texImage2D(target, level, internalformat, width, height, border,
format, type, 0); |
| 1013 } | 1019 } |
| 1014 | 1020 |
| 1015 } // namespace WebCore | 1021 } // namespace WebCore |
| OLD | NEW |