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 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
616 children_[i]->OnDeviceScaleFactorChanged(device_scale_factor); | 616 children_[i]->OnDeviceScaleFactorChanged(device_scale_factor); |
617 if (layer_mask_) | 617 if (layer_mask_) |
618 layer_mask_->OnDeviceScaleFactorChanged(device_scale_factor); | 618 layer_mask_->OnDeviceScaleFactorChanged(device_scale_factor); |
619 } | 619 } |
620 | 620 |
621 void Layer::RequestCopyOfOutput(scoped_ptr<cc::CopyOutputRequest> request) { | 621 void Layer::RequestCopyOfOutput(scoped_ptr<cc::CopyOutputRequest> request) { |
622 cc_layer_->RequestCopyOfOutput(request.Pass()); | 622 cc_layer_->RequestCopyOfOutput(request.Pass()); |
623 } | 623 } |
624 | 624 |
625 void Layer::PaintContents(SkCanvas* sk_canvas, | 625 void Layer::PaintContents(SkCanvas* sk_canvas, |
626 gfx::Rect clip, | 626 const gfx::Rect& clip, |
627 gfx::RectF* opaque) { | 627 gfx::RectF* opaque) { |
628 TRACE_EVENT0("ui", "Layer::PaintContents"); | 628 TRACE_EVENT0("ui", "Layer::PaintContents"); |
629 scoped_ptr<gfx::Canvas> canvas(gfx::Canvas::CreateCanvasWithoutScaling( | 629 scoped_ptr<gfx::Canvas> canvas(gfx::Canvas::CreateCanvasWithoutScaling( |
630 sk_canvas, device_scale_factor_)); | 630 sk_canvas, device_scale_factor_)); |
631 | 631 |
632 bool scale_content = scale_content_; | 632 bool scale_content = scale_content_; |
633 if (scale_content) { | 633 if (scale_content) { |
634 canvas->Save(); | 634 canvas->Save(); |
635 canvas->sk_canvas()->scale(SkFloatToScalar(device_scale_factor_), | 635 canvas->sk_canvas()->scale(SkFloatToScalar(device_scale_factor_), |
636 SkFloatToScalar(device_scale_factor_)); | 636 SkFloatToScalar(device_scale_factor_)); |
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
961 cc_layer_->SetBounds(ConvertSizeToPixel(this, size)); | 961 cc_layer_->SetBounds(ConvertSizeToPixel(this, size)); |
962 } | 962 } |
963 | 963 |
964 void Layer::RecomputePosition() { | 964 void Layer::RecomputePosition() { |
965 cc_layer_->SetPosition(gfx::ScalePoint( | 965 cc_layer_->SetPosition(gfx::ScalePoint( |
966 gfx::PointF(bounds_.x(), bounds_.y()), | 966 gfx::PointF(bounds_.x(), bounds_.y()), |
967 device_scale_factor_)); | 967 device_scale_factor_)); |
968 } | 968 } |
969 | 969 |
970 } // namespace ui | 970 } // namespace ui |
OLD | NEW |