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

Unified Diff: pdf/out_of_process_instance.cc

Issue 2541903002: PDF pinch zoom: Update layer transform for a zoom out after a zoom in. (Closed)
Patch Set: Created 4 years 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: pdf/out_of_process_instance.cc
diff --git a/pdf/out_of_process_instance.cc b/pdf/out_of_process_instance.cc
index 727e671157bf146579906ee3787915ee24da0a4a..419d1f6bde0f03a666578e8f9027d08a1516bca5 100644
--- a/pdf/out_of_process_instance.cc
+++ b/pdf/out_of_process_instance.cc
@@ -428,7 +428,13 @@ void OutOfProcessInstance::HandleMessage(const pp::Var& message) {
return;
}
- if (pinch_phase == PINCH_UPDATE_ZOOM_IN) {
+ // When zooming in, we set a layer transform to avoid unneeded rerasters.
+ // Also, if we're zooming out and the last time we rerastered was when
+ // we were even further zoomed out (i.e. we pinch zoomed in and are now
+ // pinch zooming back out in the same gesture), we update the layer
+ // transform instead of rerastering.
+ if (pinch_phase == PINCH_UPDATE_ZOOM_IN ||
+ (pinch_phase == PINCH_UPDATE_ZOOM_OUT && zoom_ratio > 1.0)) {
if (!(dict.Get(pp::Var(kJSPinchX)).is_number() &&
dict.Get(pp::Var(kJSPinchY)).is_number() &&
dict.Get(pp::Var(kJSPinchVectorX)).is_number() &&
« 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