| 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 "chrome/browser/chromeos/display/overscan_calibrator.h" | 5 #include "chrome/browser/chromeos/display/overscan_calibrator.h" |
| 6 | 6 |
| 7 #include <stdint.h> |
| 8 |
| 9 #include <limits> |
| 10 |
| 7 #include "ash/display/display_info.h" | 11 #include "ash/display/display_info.h" |
| 8 #include "ash/display/display_manager.h" | 12 #include "ash/display/display_manager.h" |
| 9 #include "ash/display/window_tree_host_manager.h" | 13 #include "ash/display/window_tree_host_manager.h" |
| 10 #include "ash/shell.h" | 14 #include "ash/shell.h" |
| 11 #include "ash/shell_window_ids.h" | 15 #include "ash/shell_window_ids.h" |
| 12 #include "base/callback.h" | 16 #include "base/callback.h" |
| 13 #include "third_party/skia/include/core/SkColor.h" | 17 #include "third_party/skia/include/core/SkColor.h" |
| 14 #include "third_party/skia/include/core/SkPaint.h" | 18 #include "third_party/skia/include/core/SkPaint.h" |
| 15 #include "third_party/skia/include/core/SkPath.h" | 19 #include "third_party/skia/include/core/SkPath.h" |
| 16 #include "ui/aura/window.h" | 20 #include "ui/aura/window.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 31 const int kArrowGapWidth = 0; | 35 const int kArrowGapWidth = 0; |
| 32 | 36 |
| 33 // Draw the arrow for the overscan calibration to |canvas|. | 37 // Draw the arrow for the overscan calibration to |canvas|. |
| 34 void DrawTriangle(int x_offset, | 38 void DrawTriangle(int x_offset, |
| 35 int y_offset, | 39 int y_offset, |
| 36 double rotation_degree, | 40 double rotation_degree, |
| 37 gfx::Canvas* canvas) { | 41 gfx::Canvas* canvas) { |
| 38 // Draw triangular arrows. | 42 // Draw triangular arrows. |
| 39 SkPaint content_paint; | 43 SkPaint content_paint; |
| 40 content_paint.setStyle(SkPaint::kFill_Style); | 44 content_paint.setStyle(SkPaint::kFill_Style); |
| 41 content_paint.setColor(SkColorSetA(SK_ColorBLACK, kuint8max * kArrowOpacity)); | 45 content_paint.setColor(SkColorSetA( |
| 46 SK_ColorBLACK, std::numeric_limits<uint8_t>::max() * kArrowOpacity)); |
| 42 SkPaint border_paint; | 47 SkPaint border_paint; |
| 43 border_paint.setStyle(SkPaint::kStroke_Style); | 48 border_paint.setStyle(SkPaint::kStroke_Style); |
| 44 border_paint.setColor(SkColorSetA(SK_ColorWHITE, kuint8max * kArrowOpacity)); | 49 border_paint.setColor(SkColorSetA( |
| 50 SK_ColorWHITE, std::numeric_limits<uint8_t>::max() * kArrowOpacity)); |
| 45 | 51 |
| 46 SkPath base_path; | 52 SkPath base_path; |
| 47 base_path.moveTo(0, 0); | 53 base_path.moveTo(0, 0); |
| 48 base_path.lineTo(SkIntToScalar(-kCalibrationArrowHeight), | 54 base_path.lineTo(SkIntToScalar(-kCalibrationArrowHeight), |
| 49 SkIntToScalar(-kCalibrationArrowHeight)); | 55 SkIntToScalar(-kCalibrationArrowHeight)); |
| 50 base_path.lineTo(SkIntToScalar(kCalibrationArrowHeight), | 56 base_path.lineTo(SkIntToScalar(kCalibrationArrowHeight), |
| 51 SkIntToScalar(-kCalibrationArrowHeight)); | 57 SkIntToScalar(-kCalibrationArrowHeight)); |
| 52 base_path.close(); | 58 base_path.close(); |
| 53 | 59 |
| 54 SkPath path; | 60 SkPath path; |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 float device_scale_factor) { | 157 float device_scale_factor) { |
| 152 // TODO(mukai): Cancel the overscan calibration when the device | 158 // TODO(mukai): Cancel the overscan calibration when the device |
| 153 // configuration has changed. | 159 // configuration has changed. |
| 154 } | 160 } |
| 155 | 161 |
| 156 base::Closure OverscanCalibrator::PrepareForLayerBoundsChange() { | 162 base::Closure OverscanCalibrator::PrepareForLayerBoundsChange() { |
| 157 return base::Closure(); | 163 return base::Closure(); |
| 158 } | 164 } |
| 159 | 165 |
| 160 } // namespace chromeos | 166 } // namespace chromeos |
| OLD | NEW |