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

Side by Side Diff: cc/direct_renderer.cc

Issue 12036091: Fixes a bug when the framebuffer is cleared with invalid scissor rect (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Moved check to FakeRendererGL. Created 7 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | cc/gl_renderer.h » ('j') | cc/gl_renderer.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/direct_renderer.h" 5 #include "cc/direct_renderer.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 return; 233 return;
234 234
235 bool usingScissorAsOptimization = capabilities().usingPartialSwap; 235 bool usingScissorAsOptimization = capabilities().usingPartialSwap;
236 gfx::RectF renderPassScissor; 236 gfx::RectF renderPassScissor;
237 237
238 if (usingScissorAsOptimization) { 238 if (usingScissorAsOptimization) {
239 renderPassScissor = computeScissorRectForRenderPass(frame); 239 renderPassScissor = computeScissorRectForRenderPass(frame);
240 setScissorTestRect(moveScissorToWindowSpace(frame, renderPassScissor)); 240 setScissorTestRect(moveScissorToWindowSpace(frame, renderPassScissor));
241 } 241 }
242 242
243 if (frame.currentRenderPass != frame.rootRenderPass || m_client->shouldClear RootRenderPass()) 243 if (frame.currentRenderPass != frame.rootRenderPass || m_client->shouldClear RootRenderPass()) {
244 if (!usingScissorAsOptimization)
245 ensureScissorTestDisabled();
244 clearFramebuffer(frame); 246 clearFramebuffer(frame);
247 }
245 248
246 const QuadList& quadList = renderPass->quad_list; 249 const QuadList& quadList = renderPass->quad_list;
247 for (QuadList::constBackToFrontIterator it = quadList.backToFrontBegin(); it != quadList.backToFrontEnd(); ++it) { 250 for (QuadList::constBackToFrontIterator it = quadList.backToFrontBegin(); it != quadList.backToFrontEnd(); ++it) {
248 const DrawQuad& quad = *(*it); 251 const DrawQuad& quad = *(*it);
249 bool shouldSkipQuad = false; 252 bool shouldSkipQuad = false;
250 253
251 if (usingScissorAsOptimization) 254 if (usingScissorAsOptimization)
252 setScissorStateForQuadWithRenderPassScissor(frame, quad, renderPassS cissor, &shouldSkipQuad); 255 setScissorStateForQuadWithRenderPassScissor(frame, quad, renderPassS cissor, &shouldSkipQuad);
253 else 256 else
254 setScissorStateForQuad(frame, quad); 257 setScissorStateForQuad(frame, quad);
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 return pass->output_rect.size(); 301 return pass->output_rect.size();
299 } 302 }
300 303
301 // static 304 // static
302 GLenum DirectRenderer::renderPassTextureFormat(const RenderPass*) 305 GLenum DirectRenderer::renderPassTextureFormat(const RenderPass*)
303 { 306 {
304 return GL_RGBA; 307 return GL_RGBA;
305 } 308 }
306 309
307 } // namespace cc 310 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/gl_renderer.h » ('j') | cc/gl_renderer.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698