OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "ui/compositor/layer.h" | 5 #include "ui/compositor/layer.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
630 | 630 |
631 void Layer::RequestCopyOfOutput(scoped_ptr<cc::CopyOutputRequest> request) { | 631 void Layer::RequestCopyOfOutput(scoped_ptr<cc::CopyOutputRequest> request) { |
632 cc_layer_->RequestCopyOfOutput(request.Pass()); | 632 cc_layer_->RequestCopyOfOutput(request.Pass()); |
633 } | 633 } |
634 | 634 |
635 void Layer::PaintContents(SkCanvas* sk_canvas, | 635 void Layer::PaintContents(SkCanvas* sk_canvas, |
636 gfx::Rect clip, | 636 gfx::Rect clip, |
637 gfx::RectF* opaque) { | 637 gfx::RectF* opaque) { |
638 TRACE_EVENT0("ui", "Layer::PaintContents"); | 638 TRACE_EVENT0("ui", "Layer::PaintContents"); |
639 scoped_ptr<gfx::Canvas> canvas(gfx::Canvas::CreateCanvasWithoutScaling( | 639 scoped_ptr<gfx::Canvas> canvas(gfx::Canvas::CreateCanvasWithoutScaling( |
640 sk_canvas, ui::GetScaleFactorFromScale(device_scale_factor_))); | 640 sk_canvas, device_scale_factor_)); |
641 | 641 |
642 bool scale_content = scale_content_; | 642 bool scale_content = scale_content_; |
643 if (scale_content) { | 643 if (scale_content) { |
644 canvas->Save(); | 644 canvas->Save(); |
645 canvas->sk_canvas()->scale(SkFloatToScalar(device_scale_factor_), | 645 canvas->sk_canvas()->scale(SkFloatToScalar(device_scale_factor_), |
646 SkFloatToScalar(device_scale_factor_)); | 646 SkFloatToScalar(device_scale_factor_)); |
647 } | 647 } |
648 | 648 |
649 if (delegate_) | 649 if (delegate_) |
650 delegate_->OnPaintLayer(canvas.get()); | 650 delegate_->OnPaintLayer(canvas.get()); |
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
971 cc_layer_->SetBounds(ConvertSizeToPixel(this, size)); | 971 cc_layer_->SetBounds(ConvertSizeToPixel(this, size)); |
972 } | 972 } |
973 | 973 |
974 void Layer::RecomputePosition() { | 974 void Layer::RecomputePosition() { |
975 cc_layer_->SetPosition(gfx::ScalePoint( | 975 cc_layer_->SetPosition(gfx::ScalePoint( |
976 gfx::PointF(bounds_.x(), bounds_.y()), | 976 gfx::PointF(bounds_.x(), bounds_.y()), |
977 device_scale_factor_)); | 977 device_scale_factor_)); |
978 } | 978 } |
979 | 979 |
980 } // namespace ui | 980 } // namespace ui |
OLD | NEW |