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

Side by Side Diff: chrome/browser/chromeos/display/overscan_calibrator.cc

Issue 1053143002: Make View::Paint use ui::PaintRecorder to access PaintContext's canvas (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: paintrecorder: . Created 5 years, 8 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
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 "chrome/browser/chromeos/display/overscan_calibrator.h" 5 #include "chrome/browser/chromeos/display/overscan_calibrator.h"
6 6
7 #include "ash/display/display_controller.h" 7 #include "ash/display/display_controller.h"
8 #include "ash/display/display_info.h" 8 #include "ash/display/display_info.h"
9 #include "ash/display/display_manager.h" 9 #include "ash/display/display_manager.h"
10 #include "ash/shell.h" 10 #include "ash/shell.h"
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 } 108 }
109 109
110 void OverscanCalibrator::UpdateInsets(const gfx::Insets& insets) { 110 void OverscanCalibrator::UpdateInsets(const gfx::Insets& insets) {
111 insets_.Set(std::max(insets.top(), 0), 111 insets_.Set(std::max(insets.top(), 0),
112 std::max(insets.left(), 0), 112 std::max(insets.left(), 0),
113 std::max(insets.bottom(), 0), 113 std::max(insets.bottom(), 0),
114 std::max(insets.right(), 0)); 114 std::max(insets.right(), 0));
115 calibration_layer_->SchedulePaint(calibration_layer_->bounds()); 115 calibration_layer_->SchedulePaint(calibration_layer_->bounds());
116 } 116 }
117 117
118 void OverscanCalibrator::OnPaintLayer(gfx::Canvas* canvas) { 118 void OverscanCalibrator::OnPaintLayer(const ui::PaintContext& context) {
119 gfx::Canvas* canvas = context.canvas();
119 static const SkColor kTransparent = SkColorSetARGB(0, 0, 0, 0); 120 static const SkColor kTransparent = SkColorSetARGB(0, 0, 0, 0);
120 gfx::Rect full_bounds = calibration_layer_->bounds(); 121 gfx::Rect full_bounds = calibration_layer_->bounds();
121 gfx::Rect inner_bounds = full_bounds; 122 gfx::Rect inner_bounds = full_bounds;
122 inner_bounds.Inset(insets_); 123 inner_bounds.Inset(insets_);
123 canvas->FillRect(full_bounds, SK_ColorBLACK); 124 canvas->FillRect(full_bounds, SK_ColorBLACK);
124 canvas->FillRect(inner_bounds, kTransparent, SkXfermode::kClear_Mode); 125 canvas->FillRect(inner_bounds, kTransparent, SkXfermode::kClear_Mode);
125 126
126 gfx::Point center = inner_bounds.CenterPoint(); 127 gfx::Point center = inner_bounds.CenterPoint();
127 int vertical_offset = inner_bounds.height() / 2 - kArrowGapWidth; 128 int vertical_offset = inner_bounds.height() / 2 - kArrowGapWidth;
128 int horizontal_offset = inner_bounds.width() / 2 - kArrowGapWidth; 129 int horizontal_offset = inner_bounds.width() / 2 - kArrowGapWidth;
(...skipping 12 matching lines...) Expand all
141 float device_scale_factor) { 142 float device_scale_factor) {
142 // TODO(mukai): Cancel the overscan calibration when the device 143 // TODO(mukai): Cancel the overscan calibration when the device
143 // configuration has changed. 144 // configuration has changed.
144 } 145 }
145 146
146 base::Closure OverscanCalibrator::PrepareForLayerBoundsChange() { 147 base::Closure OverscanCalibrator::PrepareForLayerBoundsChange() {
147 return base::Closure(); 148 return base::Closure();
148 } 149 }
149 150
150 } // namespace chromeos 151 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698