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 #ifndef CHROME_BROWSER_CHROMEOS_DISPLAY_OVERSCAN_CALIBRATOR_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_DISPLAY_OVERSCAN_CALIBRATOR_H_ |
6 #define CHROME_BROWSER_CHROMEOS_DISPLAY_OVERSCAN_CALIBRATOR_H_ | 6 #define CHROME_BROWSER_CHROMEOS_DISPLAY_OVERSCAN_CALIBRATOR_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "ui/compositor/layer_delegate.h" | 10 #include "ui/compositor/layer_delegate.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 // calibrating display overscan settings. | 22 // calibrating display overscan settings. |
23 class OverscanCalibrator : public ui::LayerDelegate { | 23 class OverscanCalibrator : public ui::LayerDelegate { |
24 public: | 24 public: |
25 OverscanCalibrator(const gfx::Display& target_display, | 25 OverscanCalibrator(const gfx::Display& target_display, |
26 const gfx::Insets& initial_insets); | 26 const gfx::Insets& initial_insets); |
27 virtual ~OverscanCalibrator(); | 27 virtual ~OverscanCalibrator(); |
28 | 28 |
29 // Commits the current insets data to the system. | 29 // Commits the current insets data to the system. |
30 void Commit(); | 30 void Commit(); |
31 | 31 |
| 32 // Reset the overscan insets to default value. If the display has |
| 33 // overscan, the default value is the display's default overscan |
| 34 // value. Otherwise, the default value is the old |initial_insets|. |
| 35 void Reset(); |
| 36 |
32 // Updates the insets and redraw the visual feedback. | 37 // Updates the insets and redraw the visual feedback. |
33 void UpdateInsets(const gfx::Insets& insets); | 38 void UpdateInsets(const gfx::Insets& insets); |
34 | 39 |
35 const gfx::Insets& insets() const { return insets_; } | 40 const gfx::Insets& insets() const { return insets_; } |
36 | 41 |
37 private: | 42 private: |
38 // ui::LayerDelegate overrides: | 43 // ui::LayerDelegate overrides: |
39 virtual void OnPaintLayer(gfx::Canvas* canvas) OVERRIDE; | 44 virtual void OnPaintLayer(gfx::Canvas* canvas) OVERRIDE; |
40 virtual void OnDeviceScaleFactorChanged(float device_scale_factor) OVERRIDE; | 45 virtual void OnDeviceScaleFactorChanged(float device_scale_factor) OVERRIDE; |
41 virtual base::Closure PrepareForLayerBoundsChange() OVERRIDE; | 46 virtual base::Closure PrepareForLayerBoundsChange() OVERRIDE; |
42 | 47 |
43 // The target display. | 48 // The target display. |
44 const gfx::Display display_; | 49 const gfx::Display display_; |
45 | 50 |
46 // The current insets. | 51 // The current insets. |
47 gfx::Insets insets_; | 52 gfx::Insets insets_; |
48 | 53 |
49 // The insets initially given. Stored so we can undo the insets later. | 54 // The insets initially given. Stored so we can undo the insets later. |
50 gfx::Insets initial_insets_; | 55 gfx::Insets initial_insets_; |
51 | 56 |
| 57 // The insets claimed by the display. |
| 58 gfx::Insets native_insets_; |
| 59 |
52 // Whether the current insets are committed to the system or not. | 60 // Whether the current insets are committed to the system or not. |
53 bool committed_; | 61 bool committed_; |
54 | 62 |
55 // The visualization layer for the current calibration region. | 63 // The visualization layer for the current calibration region. |
56 scoped_ptr<ui::Layer> calibration_layer_; | 64 scoped_ptr<ui::Layer> calibration_layer_; |
57 | 65 |
58 DISALLOW_COPY_AND_ASSIGN(OverscanCalibrator); | 66 DISALLOW_COPY_AND_ASSIGN(OverscanCalibrator); |
59 }; | 67 }; |
60 | 68 |
61 } // namespace chromeos | 69 } // namespace chromeos |
62 | 70 |
63 #endif // CHROME_BROWSER_CHROMEOS_DISPLAY_OVERSCAN_CALIBRATOR_H_ | 71 #endif // CHROME_BROWSER_CHROMEOS_DISPLAY_OVERSCAN_CALIBRATOR_H_ |
OLD | NEW |