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/debug/trace_event.h" | 7 #include "base/debug/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 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 | 388 |
389 TRACE_EVENT0("cc", | 389 TRACE_EVENT0("cc", |
390 "SoftwareRenderer::DrawPictureQuad"); | 390 "SoftwareRenderer::DrawPictureQuad"); |
391 | 391 |
392 // Create and run on-demand raster task for tile. | 392 // Create and run on-demand raster task for tile. |
393 scoped_refptr<Task> on_demand_raster_task( | 393 scoped_refptr<Task> on_demand_raster_task( |
394 new OnDemandRasterTaskImpl(quad->picture_pile, | 394 new OnDemandRasterTaskImpl(quad->picture_pile, |
395 current_canvas_, | 395 current_canvas_, |
396 quad->content_rect, | 396 quad->content_rect, |
397 quad->contents_scale)); | 397 quad->contents_scale)); |
398 RunOnDemandRasterTask(on_demand_raster_task.get()); | 398 client_->RunOnDemandRasterTask(on_demand_raster_task.get()); |
399 | 399 |
400 current_canvas_->setDrawFilter(NULL); | 400 current_canvas_->setDrawFilter(NULL); |
401 } | 401 } |
402 | 402 |
403 void SoftwareRenderer::DrawSolidColorQuad(const DrawingFrame* frame, | 403 void SoftwareRenderer::DrawSolidColorQuad(const DrawingFrame* frame, |
404 const SolidColorDrawQuad* quad) { | 404 const SolidColorDrawQuad* quad) { |
405 gfx::RectF visible_quad_vertex_rect = MathUtil::ScaleRectProportional( | 405 gfx::RectF visible_quad_vertex_rect = MathUtil::ScaleRectProportional( |
406 QuadVertexRect(), quad->rect, quad->visible_rect); | 406 QuadVertexRect(), quad->rect, quad->visible_rect); |
407 current_paint_.setColor(quad->color); | 407 current_paint_.setColor(quad->color); |
408 current_paint_.setAlpha(quad->opacity() * SkColorGetA(quad->color)); | 408 current_paint_.setAlpha(quad->opacity() * SkColorGetA(quad->color)); |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
645 } | 645 } |
646 | 646 |
647 void SoftwareRenderer::DidChangeVisibility() { | 647 void SoftwareRenderer::DidChangeVisibility() { |
648 if (visible()) | 648 if (visible()) |
649 EnsureBackbuffer(); | 649 EnsureBackbuffer(); |
650 else | 650 else |
651 DiscardBackbuffer(); | 651 DiscardBackbuffer(); |
652 } | 652 } |
653 | 653 |
654 } // namespace cc | 654 } // namespace cc |
OLD | NEW |