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

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

Issue 253013003: Enable disabling WebCore::GraphicsContext in telemetry. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Patch to land Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « ui/compositor/layer.h ('k') | webkit/renderer/compositor_bindings/web_content_layer_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 636 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 ContentLayerClient::GraphicsContextStatus gc_status) {
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
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
OLDNEW
« no previous file with comments | « ui/compositor/layer.h ('k') | webkit/renderer/compositor_bindings/web_content_layer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698