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/software_renderer.h" | 5 #include "cc/software_renderer.h" |
6 | 6 |
7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
8 #include "cc/debug_border_draw_quad.h" | 8 #include "cc/debug_border_draw_quad.h" |
9 #include "cc/math_util.h" | 9 #include "cc/math_util.h" |
10 #include "cc/render_pass_draw_quad.h" | 10 #include "cc/render_pass_draw_quad.h" |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 | 176 |
177 LOG(FATAL) << "Invalid resource type."; | 177 LOG(FATAL) << "Invalid resource type."; |
178 return false; | 178 return false; |
179 } | 179 } |
180 | 180 |
181 void SoftwareRenderer::drawQuad(DrawingFrame& frame, const DrawQuad* quad) | 181 void SoftwareRenderer::drawQuad(DrawingFrame& frame, const DrawQuad* quad) |
182 { | 182 { |
183 TRACE_EVENT0("cc", "SoftwareRenderer::drawQuad"); | 183 TRACE_EVENT0("cc", "SoftwareRenderer::drawQuad"); |
184 gfx::Transform quadRectMatrix; | 184 gfx::Transform quadRectMatrix; |
185 quadRectTransform(&quadRectMatrix, quad->quadTransform(), quad->rect); | 185 quadRectTransform(&quadRectMatrix, quad->quadTransform(), quad->rect); |
186 gfx::Transform contentsDeviceTransform = MathUtil::to2dTransform(frame.windo
wMatrix * frame.projectionMatrix * quadRectMatrix); | 186 gfx::Transform contentsDeviceTransform = frame.windowMatrix * frame.projecti
onMatrix * quadRectMatrix; |
| 187 contentsDeviceTransform.FlattenTo2d(); |
187 SkMatrix skDeviceMatrix; | 188 SkMatrix skDeviceMatrix; |
188 toSkMatrix(&skDeviceMatrix, contentsDeviceTransform); | 189 toSkMatrix(&skDeviceMatrix, contentsDeviceTransform); |
189 m_skCurrentCanvas->setMatrix(skDeviceMatrix); | 190 m_skCurrentCanvas->setMatrix(skDeviceMatrix); |
190 | 191 |
191 m_skCurrentPaint.reset(); | 192 m_skCurrentPaint.reset(); |
192 if (!isScaleAndTranslate(skDeviceMatrix)) { | 193 if (!isScaleAndTranslate(skDeviceMatrix)) { |
193 m_skCurrentPaint.setAntiAlias(true); | 194 m_skCurrentPaint.setAntiAlias(true); |
194 m_skCurrentPaint.setFilterBitmap(true); | 195 m_skCurrentPaint.setFilterBitmap(true); |
195 } | 196 } |
196 | 197 |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 } | 370 } |
370 | 371 |
371 void SoftwareRenderer::setVisible(bool visible) | 372 void SoftwareRenderer::setVisible(bool visible) |
372 { | 373 { |
373 if (m_visible == visible) | 374 if (m_visible == visible) |
374 return; | 375 return; |
375 m_visible = visible; | 376 m_visible = visible; |
376 } | 377 } |
377 | 378 |
378 } // namespace cc | 379 } // namespace cc |
OLD | NEW |