| 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 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 // (http://crbug.com/280374). | 343 // (http://crbug.com/280374). |
| 344 skia::RefPtr<SkDrawFilter> opacity_filter = | 344 skia::RefPtr<SkDrawFilter> opacity_filter = |
| 345 skia::AdoptRef(new skia::OpacityDrawFilter( | 345 skia::AdoptRef(new skia::OpacityDrawFilter( |
| 346 quad->opacity(), frame->disable_picture_quad_image_filtering)); | 346 quad->opacity(), frame->disable_picture_quad_image_filtering)); |
| 347 DCHECK(!current_canvas_->getDrawFilter()); | 347 DCHECK(!current_canvas_->getDrawFilter()); |
| 348 current_canvas_->setDrawFilter(opacity_filter.get()); | 348 current_canvas_->setDrawFilter(opacity_filter.get()); |
| 349 | 349 |
| 350 TRACE_EVENT0("cc", | 350 TRACE_EVENT0("cc", |
| 351 "SoftwareRenderer::DrawPictureQuad"); | 351 "SoftwareRenderer::DrawPictureQuad"); |
| 352 | 352 |
| 353 quad->picture_pile->RasterDirect(current_canvas_, quad->content_rect, | 353 quad->raster_source->PlaybackToSharedCanvas( |
| 354 quad->contents_scale); | 354 current_canvas_, quad->content_rect, quad->contents_scale); |
| 355 | 355 |
| 356 current_canvas_->setDrawFilter(NULL); | 356 current_canvas_->setDrawFilter(NULL); |
| 357 } | 357 } |
| 358 | 358 |
| 359 void SoftwareRenderer::DrawSolidColorQuad(const DrawingFrame* frame, | 359 void SoftwareRenderer::DrawSolidColorQuad(const DrawingFrame* frame, |
| 360 const SolidColorDrawQuad* quad) { | 360 const SolidColorDrawQuad* quad) { |
| 361 gfx::RectF visible_quad_vertex_rect = MathUtil::ScaleRectProportional( | 361 gfx::RectF visible_quad_vertex_rect = MathUtil::ScaleRectProportional( |
| 362 QuadVertexRect(), quad->rect, quad->visible_rect); | 362 QuadVertexRect(), quad->rect, quad->visible_rect); |
| 363 current_paint_.setColor(quad->color); | 363 current_paint_.setColor(quad->color); |
| 364 current_paint_.setAlpha(quad->opacity() * SkColorGetA(quad->color)); | 364 current_paint_.setAlpha(quad->opacity() * SkColorGetA(quad->color)); |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 600 } | 600 } |
| 601 | 601 |
| 602 void SoftwareRenderer::DidChangeVisibility() { | 602 void SoftwareRenderer::DidChangeVisibility() { |
| 603 if (visible()) | 603 if (visible()) |
| 604 EnsureBackbuffer(); | 604 EnsureBackbuffer(); |
| 605 else | 605 else |
| 606 DiscardBackbuffer(); | 606 DiscardBackbuffer(); |
| 607 } | 607 } |
| 608 | 608 |
| 609 } // namespace cc | 609 } // namespace cc |
| OLD | NEW |