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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 , m_multisampleColorBuffer(0) | 126 , m_multisampleColorBuffer(0) |
127 , m_contentsChanged(true) | 127 , m_contentsChanged(true) |
128 , m_internalColorFormat(0) | 128 , m_internalColorFormat(0) |
129 , m_colorFormat(0) | 129 , m_colorFormat(0) |
130 , m_internalRenderbufferFormat(0) | 130 , m_internalRenderbufferFormat(0) |
131 , m_maxTextureSize(0) | 131 , m_maxTextureSize(0) |
132 , m_contextEvictionManager(contextEvictionManager) | 132 , m_contextEvictionManager(contextEvictionManager) |
133 { | 133 { |
134 // Used by browser tests to detect the use of a DrawingBuffer. | 134 // Used by browser tests to detect the use of a DrawingBuffer. |
135 TRACE_EVENT_INSTANT0("test_gpu", "DrawingBufferCreation"); | 135 TRACE_EVENT_INSTANT0("test_gpu", "DrawingBufferCreation"); |
| 136 // Before enabling mailboxes for canvas, make sure the scenarios |
| 137 // from http://crbug.com/234428 do not reproduce! |
136 #if !ENABLE(CANVAS_USES_MAILBOX) | 138 #if !ENABLE(CANVAS_USES_MAILBOX) |
137 // We need a separate front and back textures if ... | 139 // We need a separate front and back textures if ... |
138 m_separateFrontTexture = m_preserveDrawingBuffer == Preserve // ... we have
to preserve contents after compositing, which is done with a copy or ... | 140 m_separateFrontTexture = m_preserveDrawingBuffer == Preserve // ... we have
to preserve contents after compositing, which is done with a copy or ... |
139 || WebKit::Platform::current()->isThreadedCompositi
ngEnabled(); // ... if we're in threaded mode and need to double buffer. | 141 || WebKit::Platform::current()->isThreadedCompositi
ngEnabled(); // ... if we're in threaded mode and need to double buffer. |
| 142 |
| 143 #if OS(DARWIN) |
| 144 // http://crbug.com/234428 : always use a separate front texture |
| 145 // on Mac OS. Doing this on all GPUs, not just NVIDIA GPUs, |
| 146 // ensures consistent behavior and is much less code. |
| 147 m_separateFrontTexture = true; |
| 148 #endif // OS(DARWIN) |
| 149 |
140 #endif // !ENABLE(CANVAS_USES_MAILBOX) | 150 #endif // !ENABLE(CANVAS_USES_MAILBOX) |
141 initialize(size); | 151 initialize(size); |
142 } | 152 } |
143 | 153 |
144 DrawingBuffer::~DrawingBuffer() | 154 DrawingBuffer::~DrawingBuffer() |
145 { | 155 { |
146 releaseResources(); | 156 releaseResources(); |
147 } | 157 } |
148 | 158 |
149 unsigned DrawingBuffer::prepareTexture(WebKit::WebTextureUpdater& updater) | 159 unsigned DrawingBuffer::prepareTexture(WebKit::WebTextureUpdater& updater) |
(...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
808 | 818 |
809 void DrawingBuffer::bind() | 819 void DrawingBuffer::bind() |
810 { | 820 { |
811 if (!m_context) | 821 if (!m_context) |
812 return; | 822 return; |
813 | 823 |
814 m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_multisampleFBO
? m_multisampleFBO : m_fbo); | 824 m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_multisampleFBO
? m_multisampleFBO : m_fbo); |
815 } | 825 } |
816 | 826 |
817 } // namespace WebCore | 827 } // namespace WebCore |
OLD | NEW |