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

Side by Side Diff: pdf/paint_manager.h

Issue 2400743002: Improved Pinch-Zoom for PDF. (Closed)
Patch Set: Fix presubmit errors, code clean up, and refactor. Created 4 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef PDF_PAINT_MANAGER_H_ 5 #ifndef PDF_PAINT_MANAGER_H_
6 #define PDF_PAINT_MANAGER_H_ 6 #define PDF_PAINT_MANAGER_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <vector> 10 #include <vector>
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 // The given rect should be scrolled by the given amounts. 139 // The given rect should be scrolled by the given amounts.
140 void ScrollRect(const pp::Rect& clip_rect, const pp::Point& amount); 140 void ScrollRect(const pp::Rect& clip_rect, const pp::Point& amount);
141 141
142 // Returns the size of the graphics context for the next paint operation. 142 // Returns the size of the graphics context for the next paint operation.
143 // This is the pending size if a resize is pending (the plugin has called 143 // This is the pending size if a resize is pending (the plugin has called
144 // SetSize but we haven't actually painted it yet), or the current size of 144 // SetSize but we haven't actually painted it yet), or the current size of
145 // no resize is pending. 145 // no resize is pending.
146 pp::Size GetEffectiveSize() const; 146 pp::Size GetEffectiveSize() const;
147 float GetEffectiveDeviceScale() const; 147 float GetEffectiveDeviceScale() const;
148 148
149 // Set the transform for the graphics layer.
150 void SetTransform(float scale, pp::Point Origin, pp::Point Transform);
151 void SetTransform(float scale);
152
149 private: 153 private:
154 // Coalesce transforms if Flush is busy
155 float scale_;
156 pp::Point origin_, transform_;
Kevin McNee - google account 2016/10/24 15:57:55 Not used.
Kevin McNee - google account 2016/10/24 21:11:47 Done.
157
150 // Disallow copy and assign (these are unimplemented). 158 // Disallow copy and assign (these are unimplemented).
151 PaintManager(const PaintManager&); 159 PaintManager(const PaintManager&);
152 PaintManager& operator=(const PaintManager&); 160 PaintManager& operator=(const PaintManager&);
153 161
154 // Makes sure there is a callback that will trigger a paint at a later time. 162 // Makes sure there is a callback that will trigger a paint at a later time.
155 // This will be either a Flush callback telling us we're allowed to generate 163 // This will be either a Flush callback telling us we're allowed to generate
156 // more data, or, if there's no flush callback pending, a manual call back 164 // more data, or, if there's no flush callback pending, a manual call back
157 // to the message loop via ExecuteOnMainThread. 165 // to the message loop via ExecuteOnMainThread.
158 void EnsureCallbackPending(); 166 void EnsureCallbackPending();
159 167
(...skipping 18 matching lines...) Expand all
178 186
179 // This graphics device will be is_null() if no graphics has been manually 187 // This graphics device will be is_null() if no graphics has been manually
180 // set yet. 188 // set yet.
181 pp::Graphics2D graphics_; 189 pp::Graphics2D graphics_;
182 190
183 PaintAggregator aggregator_; 191 PaintAggregator aggregator_;
184 192
185 // See comment for EnsureCallbackPending for more on how these work. 193 // See comment for EnsureCallbackPending for more on how these work.
186 bool manual_callback_pending_; 194 bool manual_callback_pending_;
187 bool flush_pending_; 195 bool flush_pending_;
196 bool flush_requested_;
188 197
189 // When we get a resize, we don't bind right away (see SetSize). The 198 // When we get a resize, we don't bind right away (see SetSize). The
190 // has_pending_resize_ tells us that we need to do a resize for the next 199 // has_pending_resize_ tells us that we need to do a resize for the next
191 // paint operation. When true, the new size is in pending_size_. 200 // paint operation. When true, the new size is in pending_size_.
192 bool has_pending_resize_; 201 bool has_pending_resize_;
193 bool graphics_need_to_be_bound_; 202 bool graphics_need_to_be_bound_;
194 pp::Size pending_size_; 203 pp::Size pending_size_;
195 pp::Size plugin_size_; 204 pp::Size plugin_size_;
196 float pending_device_scale_; 205 float pending_device_scale_;
197 float device_scale_; 206 float device_scale_;
198 207
199 // True iff we're in the middle of a paint. 208 // True iff we're in the middle of a paint.
200 bool in_paint_; 209 bool in_paint_;
201 210
202 // True if we haven't painted the plugin viewport yet. 211 // True if we haven't painted the plugin viewport yet.
203 bool first_paint_; 212 bool first_paint_;
204 213
205 // True when the view size just changed and we're waiting for a paint. 214 // True when the view size just changed and we're waiting for a paint.
206 bool view_size_changed_waiting_for_paint_; 215 bool view_size_changed_waiting_for_paint_;
207 }; 216 };
208 217
209 #endif // PDF_PAINT_MANAGER_H_ 218 #endif // PDF_PAINT_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698