Chromium Code Reviews| 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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 180 renderPassesById.clear(); | 180 renderPassesById.clear(); |
| 181 } | 181 } |
| 182 | 182 |
| 183 gfx::RectF DirectRenderer::computeScissorRectForRenderPass(const DrawingFrame& f rame) | 183 gfx::RectF DirectRenderer::computeScissorRectForRenderPass(const DrawingFrame& f rame) |
| 184 { | 184 { |
| 185 gfx::RectF renderPassScissor = frame.currentRenderPass->output_rect; | 185 gfx::RectF renderPassScissor = frame.currentRenderPass->output_rect; |
| 186 | 186 |
| 187 if (frame.rootDamageRect == frame.rootRenderPass->output_rect) | 187 if (frame.rootDamageRect == frame.rootRenderPass->output_rect) |
| 188 return renderPassScissor; | 188 return renderPassScissor; |
| 189 | 189 |
| 190 gfx::Transform inverseTransform = MathUtil::inverse(frame.currentRenderPass- >transform_to_root_target); | 190 gfx::Transform inverseTransform(gfx::Transform::kSkipInitialization); |
| 191 frame.currentRenderPass->transform_to_root_target.GetInverse(&inverseTransfo rm); | |
|
danakj
2012/12/19 05:23:06
I don't see a check for invertible here. Should we
| |
| 191 gfx::RectF damageRectInRenderPassSpace = MathUtil::projectClippedRect(invers eTransform, frame.rootDamageRect); | 192 gfx::RectF damageRectInRenderPassSpace = MathUtil::projectClippedRect(invers eTransform, frame.rootDamageRect); |
| 192 renderPassScissor.Intersect(damageRectInRenderPassSpace); | 193 renderPassScissor.Intersect(damageRectInRenderPassSpace); |
| 193 | 194 |
| 194 return renderPassScissor; | 195 return renderPassScissor; |
| 195 } | 196 } |
| 196 | 197 |
| 197 void DirectRenderer::setScissorStateForQuad(const DrawingFrame& frame, const Dra wQuad& quad) | 198 void DirectRenderer::setScissorStateForQuad(const DrawingFrame& frame, const Dra wQuad& quad) |
| 198 { | 199 { |
| 199 if (quad.isClipped()) { | 200 if (quad.isClipped()) { |
| 200 gfx::RectF quadScissorRect = quad.clipRect(); | 201 gfx::RectF quadScissorRect = quad.clipRect(); |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 296 return pass->output_rect.size(); | 297 return pass->output_rect.size(); |
| 297 } | 298 } |
| 298 | 299 |
| 299 // static | 300 // static |
| 300 GLenum DirectRenderer::renderPassTextureFormat(const RenderPass*) | 301 GLenum DirectRenderer::renderPassTextureFormat(const RenderPass*) |
| 301 { | 302 { |
| 302 return GL_RGBA; | 303 return GL_RGBA; |
| 303 } | 304 } |
| 304 | 305 |
| 305 } // namespace cc | 306 } // namespace cc |
| OLD | NEW |