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 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 outMailbox->set_color_space(m_colorSpace); | 317 outMailbox->set_color_space(m_colorSpace); |
318 | 318 |
319 // This holds a ref on the DrawingBuffer that will keep it alive until the | 319 // This holds a ref on the DrawingBuffer that will keep it alive until the |
320 // mailbox is released (and while the release callback is running). It also | 320 // mailbox is released (and while the release callback is running). It also |
321 // owns the SharedBitmap. | 321 // owns the SharedBitmap. |
322 auto func = WTF::bind(&DrawingBuffer::mailboxReleasedSoftware, | 322 auto func = WTF::bind(&DrawingBuffer::mailboxReleasedSoftware, |
323 RefPtr<DrawingBuffer>(this), | 323 RefPtr<DrawingBuffer>(this), |
324 WTF::passed(std::move(bitmap)), m_size); | 324 WTF::passed(std::move(bitmap)), m_size); |
325 *outReleaseCallback = | 325 *outReleaseCallback = |
326 cc::SingleReleaseCallback::Create(convertToBaseCallback(std::move(func))); | 326 cc::SingleReleaseCallback::Create(convertToBaseCallback(std::move(func))); |
| 327 |
| 328 if (m_preserveDrawingBuffer == Discard) { |
| 329 setBufferClearNeeded(true); |
| 330 } |
| 331 |
327 return true; | 332 return true; |
328 } | 333 } |
329 | 334 |
330 bool DrawingBuffer::finishPrepareTextureMailboxGpu( | 335 bool DrawingBuffer::finishPrepareTextureMailboxGpu( |
331 cc::TextureMailbox* outMailbox, | 336 cc::TextureMailbox* outMailbox, |
332 std::unique_ptr<cc::SingleReleaseCallback>* outReleaseCallback) { | 337 std::unique_ptr<cc::SingleReleaseCallback>* outReleaseCallback) { |
333 DCHECK(m_stateRestorer); | 338 DCHECK(m_stateRestorer); |
334 if (m_webGLVersion > WebGL1) { | 339 if (m_webGLVersion > WebGL1) { |
335 m_stateRestorer->setPixelUnpackBufferBindingDirty(); | 340 m_stateRestorer->setPixelUnpackBufferBindingDirty(); |
336 m_gl->BindBuffer(GL_PIXEL_UNPACK_BUFFER, 0); | 341 m_gl->BindBuffer(GL_PIXEL_UNPACK_BUFFER, 0); |
(...skipping 959 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1296 if (m_pixelUnpackBufferBindingDirty) | 1301 if (m_pixelUnpackBufferBindingDirty) |
1297 client->DrawingBufferClientRestorePixelUnpackBufferBinding(); | 1302 client->DrawingBufferClientRestorePixelUnpackBufferBinding(); |
1298 } | 1303 } |
1299 | 1304 |
1300 bool DrawingBuffer::shouldUseChromiumImage() { | 1305 bool DrawingBuffer::shouldUseChromiumImage() { |
1301 return RuntimeEnabledFeatures::webGLImageChromiumEnabled() && | 1306 return RuntimeEnabledFeatures::webGLImageChromiumEnabled() && |
1302 m_chromiumImageUsage == AllowChromiumImage; | 1307 m_chromiumImageUsage == AllowChromiumImage; |
1303 } | 1308 } |
1304 | 1309 |
1305 } // namespace blink | 1310 } // namespace blink |
OLD | NEW |