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

Unified Diff: tools/vulkan/viewer/VulkanViewer.cpp

Issue 1876853003: Fix to zoom on Vulkan Viewer (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/vulkan/viewer/VulkanViewer.cpp
diff --git a/tools/vulkan/viewer/VulkanViewer.cpp b/tools/vulkan/viewer/VulkanViewer.cpp
index 52b6ad19f53e8e181de3901c51dac7084647ebb8..a88a337017be47c8cbedd128fde9e6d5e293ec8e 100644
--- a/tools/vulkan/viewer/VulkanViewer.cpp
+++ b/tools/vulkan/viewer/VulkanViewer.cpp
@@ -55,6 +55,10 @@ DEFINE_string(skps, "skps", "Directory to read skps from.");
VulkanViewer::VulkanViewer(int argc, char** argv, void* platformData)
: fCurrentMeasurement(0)
, fDisplayStats(false)
+ , fZoomCenterX(0.0f)
+ , fZoomCenterY(0.0f)
+ , fZoomLevel(0.0f)
+ , fZoomScale(SK_Scalar1)
{
memset(fMeasurements, 0, sizeof(fMeasurements));
@@ -221,11 +225,13 @@ bool VulkanViewer::onKey(Window::Key key, Window::InputState state, uint32_t mod
case Window::kUp_Key: {
this->changeZoomLevel(1.f / 32.f);
+ fWindow->inval();
return true;
}
case Window::kDown_Key: {
this->changeZoomLevel(-1.f / 32.f);
+ fWindow->inval();
return true;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698