| 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/output/software_renderer.h" | 5 #include "cc/output/software_renderer.h" |
| 6 | 6 |
| 7 #include "base/trace_event/trace_event.h" | 7 #include "base/trace_event/trace_event.h" |
| 8 #include "cc/base/math_util.h" | 8 #include "cc/base/math_util.h" |
| 9 #include "cc/output/compositor_frame.h" | 9 #include "cc/output/compositor_frame.h" |
| 10 #include "cc/output/compositor_frame_ack.h" | 10 #include "cc/output/compositor_frame_ack.h" |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 } | 307 } |
| 308 | 308 |
| 309 current_canvas_->resetMatrix(); | 309 current_canvas_->resetMatrix(); |
| 310 } | 310 } |
| 311 | 311 |
| 312 void SoftwareRenderer::DrawCheckerboardQuad(const DrawingFrame* frame, | 312 void SoftwareRenderer::DrawCheckerboardQuad(const DrawingFrame* frame, |
| 313 const CheckerboardDrawQuad* quad) { | 313 const CheckerboardDrawQuad* quad) { |
| 314 gfx::RectF visible_quad_vertex_rect = MathUtil::ScaleRectProportional( | 314 gfx::RectF visible_quad_vertex_rect = MathUtil::ScaleRectProportional( |
| 315 QuadVertexRect(), quad->rect, quad->visible_rect); | 315 QuadVertexRect(), quad->rect, quad->visible_rect); |
| 316 current_paint_.setColor(quad->color); | 316 current_paint_.setColor(quad->color); |
| 317 current_paint_.setAlpha(quad->opacity() * SkColorGetA(quad->color)); | 317 current_paint_.setAlpha(quad->opacity()); |
| 318 current_canvas_->drawRect(gfx::RectFToSkRect(visible_quad_vertex_rect), | 318 current_canvas_->drawRect(gfx::RectFToSkRect(visible_quad_vertex_rect), |
| 319 current_paint_); | 319 current_paint_); |
| 320 } | 320 } |
| 321 | 321 |
| 322 void SoftwareRenderer::DrawDebugBorderQuad(const DrawingFrame* frame, | 322 void SoftwareRenderer::DrawDebugBorderQuad(const DrawingFrame* frame, |
| 323 const DebugBorderDrawQuad* quad) { | 323 const DebugBorderDrawQuad* quad) { |
| 324 // We need to apply the matrix manually to have pixel-sized stroke width. | 324 // We need to apply the matrix manually to have pixel-sized stroke width. |
| 325 SkPoint vertices[4]; | 325 SkPoint vertices[4]; |
| 326 gfx::RectFToSkRect(QuadVertexRect()).toQuad(vertices); | 326 gfx::RectFToSkRect(QuadVertexRect()).toQuad(vertices); |
| 327 SkPoint transformed_vertices[4]; | 327 SkPoint transformed_vertices[4]; |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 612 } | 612 } |
| 613 | 613 |
| 614 void SoftwareRenderer::DidChangeVisibility() { | 614 void SoftwareRenderer::DidChangeVisibility() { |
| 615 if (visible()) | 615 if (visible()) |
| 616 EnsureBackbuffer(); | 616 EnsureBackbuffer(); |
| 617 else | 617 else |
| 618 DiscardBackbuffer(); | 618 DiscardBackbuffer(); |
| 619 } | 619 } |
| 620 | 620 |
| 621 } // namespace cc | 621 } // namespace cc |
| OLD | NEW |