OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |