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

Unified Diff: chromeos/display/touchscreen_delegate_x11.cc

Issue 191223007: Move touch CTM from X into Chrome (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: add file ui/aura/touch_ctm.h(cc) Created 6 years, 9 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/touchscreen_delegate_x11.cc
diff --git a/chromeos/display/touchscreen_delegate_x11.cc b/chromeos/display/touchscreen_delegate_x11.cc
index 37bb385cc3f0aa22a61769e05f9cfd7fb1c700ae..bb041c1332ebc6efbffe59241a3d52347a9833ac 100644
--- a/chromeos/display/touchscreen_delegate_x11.cc
+++ b/chromeos/display/touchscreen_delegate_x11.cc
@@ -131,44 +131,4 @@ void TouchscreenDelegateX11::AssociateTouchscreens(
XIFreeDeviceInfo(info);
}
-void TouchscreenDelegateX11::ConfigureCTM(
- int touch_device_id,
- const OutputConfigurator::CoordinateTransformation& ctm) {
- VLOG(1) << "ConfigureCTM: id=" << touch_device_id
- << " scale=" << ctm.x_scale << "x" << ctm.y_scale
- << " offset=(" << ctm.x_offset << ", " << ctm.y_offset << ")";
- int ndevices = 0;
- XIDeviceInfo* info = XIQueryDevice(display_, touch_device_id, &ndevices);
- Atom prop = XInternAtom(display_, "Coordinate Transformation Matrix", False);
- Atom float_atom = XInternAtom(display_, "FLOAT", False);
- if (ndevices == 1 && prop != None && float_atom != None) {
- Atom type;
- int format;
- unsigned long num_items;
- unsigned long bytes_after;
- unsigned char* data = NULL;
- // Verify that the property exists with correct format, type, etc.
- int status = XIGetProperty(display_, info->deviceid, prop, 0, 0, False,
- AnyPropertyType, &type, &format, &num_items, &bytes_after, &data);
- if (data)
- XFree(data);
- if (status == Success && type == float_atom && format == 32) {
- float value[3][3] = {
- { ctm.x_scale, 0.0, ctm.x_offset },
- { 0.0, ctm.y_scale, ctm.y_offset },
- { 0.0, 0.0, 1.0 }
- };
- XIChangeProperty(display_,
- info->deviceid,
- prop,
- type,
- format,
- PropModeReplace,
- reinterpret_cast<unsigned char*>(value),
- 9);
- }
- }
- XIFreeDeviceInfo(info);
-}
-
} // namespace chromeos

Powered by Google App Engine
This is Rietveld 408576698