Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(202)

Side by Side Diff: ui/compositor/layer.cc

Issue 93663004: [#2] Pass gfx structs by const ref (gfx::Rect, gfx::RectF) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase to ToT, fix builds on non-linux platforms! Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/compositor/layer.h ('k') | webkit/renderer/compositor_bindings/scrollbar_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ui/compositor/layer.h ('k') | webkit/renderer/compositor_bindings/scrollbar_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698