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

Unified Diff: chromeos/display/output_configurator.h

Issue 14279002: Scale TouchEvent's radius when touchscreen is in mirror mode (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: including chromeos/display/output_configurator.h only when defined(OS_CHROMEOS) Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/shell.cc ('k') | chromeos/display/output_configurator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/display/output_configurator.h
diff --git a/chromeos/display/output_configurator.h b/chromeos/display/output_configurator.h
index 34e9384e21b560704a40285a649d5648cab40352..faef729ae69f26b1cc06c96895a15d4dbe193ad9 100644
--- a/chromeos/display/output_configurator.h
+++ b/chromeos/display/output_configurator.h
@@ -5,6 +5,7 @@
#ifndef CHROMEOS_DISPLAY_OUTPUT_CONFIGURATOR_H_
#define CHROMEOS_DISPLAY_OUTPUT_CONFIGURATOR_H_
+#include <map>
#include <vector>
#include "base/basictypes.h"
@@ -283,6 +284,10 @@ class CHROMEOS_EXPORT OutputConfigurator : public MessageLoop::Dispatcher {
// suspended.
void ResumeDisplays();
+ const std::map<int, float>& GetMirroredDisplayAreaRatioMap() {
+ return mirrored_display_area_ratio_map_;
+ }
+
private:
// Configure outputs.
void ConfigureOutputs();
@@ -307,9 +312,22 @@ class CHROMEOS_EXPORT OutputConfigurator : public MessageLoop::Dispatcher {
CoordinateTransformation GetMirrorModeCTM(
const OutputConfigurator::OutputSnapshot* output);
+ // Returns the ratio between mirrored mode area and native mode area:
+ // (mirror_mode_width * mirrow_mode_height) / (native_width * native_height)
+ float GetMirroredDisplayAreaRatio(
+ const OutputConfigurator::OutputSnapshot* output);
+
StateController* state_controller_;
scoped_ptr<Delegate> delegate_;
+ // Key of the map is the touch display's id, and the value of the map is the
+ // touch display's area ratio in mirror mode defined as :
+ // mirror_mode_area / native_mode_area.
+ // This is used for scaling touch event's radius when the touch display is in
+ // mirror mode :
+ // new_touch_radius = sqrt(area_ratio) * old_touch_radius
+ std::map<int, float> mirrored_display_area_ratio_map_;
+
// This is detected by the constructor to determine whether or not we should
// be enabled. If we aren't running on ChromeOS, we can't assume that the
// Xrandr X11 extension is supported.
« no previous file with comments | « ash/shell.cc ('k') | chromeos/display/output_configurator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698