| 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 636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 647 if (layer_mask_) | 647 if (layer_mask_) |
| 648 layer_mask_->OnDeviceScaleFactorChanged(device_scale_factor); | 648 layer_mask_->OnDeviceScaleFactorChanged(device_scale_factor); |
| 649 } | 649 } |
| 650 | 650 |
| 651 void Layer::RequestCopyOfOutput(scoped_ptr<cc::CopyOutputRequest> request) { | 651 void Layer::RequestCopyOfOutput(scoped_ptr<cc::CopyOutputRequest> request) { |
| 652 cc_layer_->RequestCopyOfOutput(request.Pass()); | 652 cc_layer_->RequestCopyOfOutput(request.Pass()); |
| 653 } | 653 } |
| 654 | 654 |
| 655 void Layer::PaintContents(SkCanvas* sk_canvas, | 655 void Layer::PaintContents(SkCanvas* sk_canvas, |
| 656 const gfx::Rect& clip, | 656 const gfx::Rect& clip, |
| 657 gfx::RectF* opaque) { | 657 gfx::RectF* opaque, |
| 658 bool disableContext) { |
| 658 TRACE_EVENT0("ui", "Layer::PaintContents"); | 659 TRACE_EVENT0("ui", "Layer::PaintContents"); |
| 659 scoped_ptr<gfx::Canvas> canvas(gfx::Canvas::CreateCanvasWithoutScaling( | 660 scoped_ptr<gfx::Canvas> canvas(gfx::Canvas::CreateCanvasWithoutScaling( |
| 660 sk_canvas, device_scale_factor_)); | 661 sk_canvas, device_scale_factor_)); |
| 661 | 662 |
| 662 bool scale_content = scale_content_; | 663 bool scale_content = scale_content_; |
| 663 if (scale_content) { | 664 if (scale_content) { |
| 664 canvas->Save(); | 665 canvas->Save(); |
| 665 canvas->sk_canvas()->scale(SkFloatToScalar(device_scale_factor_), | 666 canvas->sk_canvas()->scale(SkFloatToScalar(device_scale_factor_), |
| 666 SkFloatToScalar(device_scale_factor_)); | 667 SkFloatToScalar(device_scale_factor_)); |
| 667 } | 668 } |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 963 cc_layer_->SetBounds(ConvertSizeToPixel(this, size)); | 964 cc_layer_->SetBounds(ConvertSizeToPixel(this, size)); |
| 964 } | 965 } |
| 965 | 966 |
| 966 void Layer::RecomputePosition() { | 967 void Layer::RecomputePosition() { |
| 967 cc_layer_->SetPosition(gfx::ScalePoint( | 968 cc_layer_->SetPosition(gfx::ScalePoint( |
| 968 gfx::PointF(bounds_.x(), bounds_.y()), | 969 gfx::PointF(bounds_.x(), bounds_.y()), |
| 969 device_scale_factor_)); | 970 device_scale_factor_)); |
| 970 } | 971 } |
| 971 | 972 |
| 972 } // namespace ui | 973 } // namespace ui |
| OLD | NEW |