Commit 785752c9 authored by Francois Beaufort's avatar Francois Beaufort Committed by Commit Bot

[PTZ] Update fake device stream when pan and tilt change

This CL makes sure the fake device stream gets updated when pan and tilt
options change so that web developers get to see effects in real-time.

Bug: 934063
Change-Id: Idaddacdbc22f1eb77a3b4e2fb9546c33e37f2fcb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2276424Reviewed-by: default avatarGuido Urdaneta <guidou@chromium.org>
Commit-Queue: François Beaufort <beaufort.francois@gmail.com>
Cr-Commit-Position: refs/heads/master@{#784474}
parent 5d506667
...@@ -432,8 +432,14 @@ void PacmanFramePainter::DrawPacman(base::TimeDelta elapsed_time, ...@@ -432,8 +432,14 @@ void PacmanFramePainter::DrawPacman(base::TimeDelta elapsed_time,
SkCanvas canvas(bitmap); SkCanvas canvas(bitmap);
const SkScalar unscaled_zoom = fake_device_state_->zoom / 100.f; const SkScalar unscaled_zoom = fake_device_state_->zoom / 100.f;
const SkScalar translate_x =
(fake_device_state_->pan - kMinPan) * (width / (kMaxPan - kMinPan));
const SkScalar translate_y =
(fake_device_state_->tilt - kMinTilt) * (height / (kMaxTilt - kMinTilt));
SkMatrix matrix; SkMatrix matrix;
matrix.setScale(unscaled_zoom, unscaled_zoom, width / 2, height / 2); matrix.setScale(unscaled_zoom, unscaled_zoom, width / 2, height / 2);
matrix.setTranslateX(translate_x);
matrix.setTranslateY(translate_y);
canvas.setMatrix(matrix); canvas.setMatrix(matrix);
// For the SK_N32 case, match the green color tone produced by the // For the SK_N32 case, match the green color tone produced by the
......
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