| 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 , m_multisampleFBO(0) | 90 , m_multisampleFBO(0) |
| 91 , m_multisampleColorBuffer(0) | 91 , m_multisampleColorBuffer(0) |
| 92 , m_contentsChanged(true) | 92 , m_contentsChanged(true) |
| 93 { | 93 { |
| 94 // Used by browser tests to detect the use of a DrawingBuffer. | 94 // Used by browser tests to detect the use of a DrawingBuffer. |
| 95 TRACE_EVENT_INSTANT0("test_gpu", "DrawingBufferCreation"); | 95 TRACE_EVENT_INSTANT0("test_gpu", "DrawingBufferCreation"); |
| 96 | 96 |
| 97 // We need a separate front and back textures if ... | 97 // We need a separate front and back textures if ... |
| 98 m_separateFrontTexture = m_preserveDrawingBuffer == Preserve // ... we have
to preserve contents after compositing, which is done with a copy or ... | 98 m_separateFrontTexture = m_preserveDrawingBuffer == Preserve // ... we have
to preserve contents after compositing, which is done with a copy or ... |
| 99 || WebKit::Platform::current()->isThreadedCompositi
ngEnabled(); // ... if we're in threaded mode and need to double buffer. | 99 || WebKit::Platform::current()->isThreadedCompositi
ngEnabled(); // ... if we're in threaded mode and need to double buffer. |
| 100 #if OS(DARWIN) |
| 101 // http://crbug.com/234428 : always use a separate front texture |
| 102 // on Mac OS. Doing this on all GPUs, not just NVIDIA GPUs, |
| 103 // ensures consistent behavior and is much less code. |
| 104 m_separateFrontTexture = true; |
| 105 #endif |
| 106 |
| 100 initialize(size); | 107 initialize(size); |
| 101 } | 108 } |
| 102 | 109 |
| 103 DrawingBuffer::~DrawingBuffer() | 110 DrawingBuffer::~DrawingBuffer() |
| 104 { | 111 { |
| 105 if (!m_context) | 112 if (!m_context) |
| 106 return; | 113 return; |
| 107 | 114 |
| 108 clear(); | 115 clear(); |
| 109 } | 116 } |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 void DrawingBuffer::clearPlatformLayer() | 261 void DrawingBuffer::clearPlatformLayer() |
| 255 { | 262 { |
| 256 if (m_private) | 263 if (m_private) |
| 257 m_private->clearTextureId(); | 264 m_private->clearTextureId(); |
| 258 | 265 |
| 259 m_context->flush(); | 266 m_context->flush(); |
| 260 } | 267 } |
| 261 #endif | 268 #endif |
| 262 | 269 |
| 263 } | 270 } |
| OLD | NEW |