Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(259)

Side by Side Diff: Source/core/platform/graphics/gpu/DrawingBuffer.cpp

Issue 14896002: Always use a separate front texture on Mac OS to work around graphics driver bugs. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698