Commit b1dd9e6c authored by chaopeng's avatar chaopeng Committed by Commit Bot

Add log for direct manipulation OnContentUpdated

The log shows the event target is not null. The issue maybe
caused by OS does not send out OnContentUpdated which is the
OS notify Chrome a event ready to read. I add a log to it see
if OnContentUpdated called by OS or ignored.

Bug: 914914
Change-Id: I0e63798c3382c2a10b7aade13600712b75bd3d31
Reviewed-on: https://chromium-review.googlesource.com/c/1489305Reviewed-by: default avatarScott Violet <sky@chromium.org>
Commit-Queue: Jianpeng Chao <chaopeng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#635919}
parent 05088197
......@@ -446,6 +446,8 @@ HRESULT DirectManipulationHandler::OnViewportStatusChanged(
HRESULT DirectManipulationHandler::OnViewportUpdated(
IDirectManipulationViewport* viewport) {
if (LoggingEnabled())
DebugLogging("OnViewportUpdated", S_OK);
// Nothing to do here.
return S_OK;
}
......@@ -477,15 +479,18 @@ HRESULT DirectManipulationHandler::OnContentUpdated(
DCHECK(viewport);
DCHECK(content);
HRESULT hr = S_OK;
if (LoggingEnabled())
DebugLogging("OnContentUpdated", S_OK);
// Windows should not call this when event_target_ is null since we do not
// pass the DM_POINTERHITTEST to DirectManipulation.
if (!event_target_)
return hr;
if (!event_target_) {
DebugLogging("OnContentUpdated event_target_ is null.", S_OK);
return S_OK;
}
float xform[6];
hr = content->GetContentTransform(xform, ARRAYSIZE(xform));
HRESULT hr = content->GetContentTransform(xform, ARRAYSIZE(xform));
if (!SUCCEEDED(hr)) {
DebugLogging("DirectManipulationContent get transform failed.", hr);
return hr;
......@@ -510,6 +515,16 @@ HRESULT DirectManipulationHandler::OnContentUpdated(
if (FloatEquals(scale, last_scale_) &&
DifferentLessThanOne(x_offset, last_x_offset_) &&
DifferentLessThanOne(y_offset, last_y_offset_)) {
if (LoggingEnabled()) {
std::string s =
"OnContentUpdated ignored. scale=" + std::to_string(scale) +
", last_scale=" + std::to_string(last_scale_) +
", x_offset=" + std::to_string(x_offset) +
", last_x_offset=" + std::to_string(last_x_offset_) +
", y_offset=" + std::to_string(y_offset) +
", last_y_offset=" + std::to_string(last_y_offset_);
DebugLogging(s, S_OK);
}
return hr;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment