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

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: header file order fix 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
Index: chromeos/display/output_configurator.h
diff --git a/chromeos/display/output_configurator.h b/chromeos/display/output_configurator.h
index 34e9384e21b560704a40285a649d5648cab40352..6287ba84b2dbc7d56a2982c8fecc1b6e8c6b678b 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();
+ std::map<int, float>* GetMirroredDisplayAreaRatioMap() {
oshima 2013/04/18 08:38:12 can this be const std::map<int, float>& ?
Yufeng Shen (Slow to review) 2013/04/18 16:22:56 Done.
+ 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.

Powered by Google App Engine
This is Rietveld 408576698