| 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 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 579 if (request->has_area()) | 579 if (request->has_area()) |
| 580 copy_rect.Intersect(request->area()); | 580 copy_rect.Intersect(request->area()); |
| 581 gfx::Rect window_copy_rect = MoveFromDrawToWindowSpace(frame, copy_rect); | 581 gfx::Rect window_copy_rect = MoveFromDrawToWindowSpace(frame, copy_rect); |
| 582 | 582 |
| 583 scoped_ptr<SkBitmap> bitmap(new SkBitmap); | 583 scoped_ptr<SkBitmap> bitmap(new SkBitmap); |
| 584 bitmap->setInfo(SkImageInfo::MakeN32Premul(window_copy_rect.width(), | 584 bitmap->setInfo(SkImageInfo::MakeN32Premul(window_copy_rect.width(), |
| 585 window_copy_rect.height())); | 585 window_copy_rect.height())); |
| 586 current_canvas_->readPixels( | 586 current_canvas_->readPixels( |
| 587 bitmap.get(), window_copy_rect.x(), window_copy_rect.y()); | 587 bitmap.get(), window_copy_rect.x(), window_copy_rect.y()); |
| 588 | 588 |
| 589 request->SendBitmapResult(bitmap.Pass()); | 589 request->SendBitmapResult(std::move(bitmap)); |
| 590 } | 590 } |
| 591 | 591 |
| 592 void SoftwareRenderer::DiscardBackbuffer() { | 592 void SoftwareRenderer::DiscardBackbuffer() { |
| 593 if (is_backbuffer_discarded_) | 593 if (is_backbuffer_discarded_) |
| 594 return; | 594 return; |
| 595 | 595 |
| 596 output_surface_->DiscardBackbuffer(); | 596 output_surface_->DiscardBackbuffer(); |
| 597 | 597 |
| 598 is_backbuffer_discarded_ = true; | 598 is_backbuffer_discarded_ = true; |
| 599 | 599 |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 713 | 713 |
| 714 if (filter_backdrop_bitmap.empty()) | 714 if (filter_backdrop_bitmap.empty()) |
| 715 return skia::RefPtr<SkShader>(); | 715 return skia::RefPtr<SkShader>(); |
| 716 | 716 |
| 717 return skia::AdoptRef(SkShader::CreateBitmapShader( | 717 return skia::AdoptRef(SkShader::CreateBitmapShader( |
| 718 filter_backdrop_bitmap, content_tile_mode, content_tile_mode, | 718 filter_backdrop_bitmap, content_tile_mode, content_tile_mode, |
| 719 &filter_backdrop_transform)); | 719 &filter_backdrop_transform)); |
| 720 } | 720 } |
| 721 | 721 |
| 722 } // namespace cc | 722 } // namespace cc |
| OLD | NEW |