OLD | NEW |
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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 // The given rect should be scrolled by the given amounts. | 137 // The given rect should be scrolled by the given amounts. |
138 void ScrollRect(const pp::Rect& clip_rect, const pp::Point& amount); | 138 void ScrollRect(const pp::Rect& clip_rect, const pp::Point& amount); |
139 | 139 |
140 // Returns the size of the graphics context for the next paint operation. | 140 // Returns the size of the graphics context for the next paint operation. |
141 // This is the pending size if a resize is pending (the plugin has called | 141 // This is the pending size if a resize is pending (the plugin has called |
142 // SetSize but we haven't actually painted it yet), or the current size of | 142 // SetSize but we haven't actually painted it yet), or the current size of |
143 // no resize is pending. | 143 // no resize is pending. |
144 pp::Size GetEffectiveSize() const; | 144 pp::Size GetEffectiveSize() const; |
145 float GetEffectiveDeviceScale() const; | 145 float GetEffectiveDeviceScale() const; |
146 | 146 |
| 147 // Set the transform for the graphics layer. |
| 148 void SetTransform(float scale, pp::Point Origin, pp::Point Transform); |
| 149 void SetTransform(float scale); |
147 private: | 150 private: |
| 151 //Coalesce transforms if Flush is busy |
| 152 float scale_; |
| 153 pp::Point origin_, transform_; |
| 154 |
148 // Disallow copy and assign (these are unimplemented). | 155 // Disallow copy and assign (these are unimplemented). |
149 PaintManager(const PaintManager&); | 156 PaintManager(const PaintManager&); |
150 PaintManager& operator=(const PaintManager&); | 157 PaintManager& operator=(const PaintManager&); |
151 | 158 |
152 // Makes sure there is a callback that will trigger a paint at a later time. | 159 // Makes sure there is a callback that will trigger a paint at a later time. |
153 // This will be either a Flush callback telling us we're allowed to generate | 160 // This will be either a Flush callback telling us we're allowed to generate |
154 // more data, or, if there's no flush callback pending, a manual call back | 161 // more data, or, if there's no flush callback pending, a manual call back |
155 // to the message loop via ExecuteOnMainThread. | 162 // to the message loop via ExecuteOnMainThread. |
156 void EnsureCallbackPending(); | 163 void EnsureCallbackPending(); |
157 | 164 |
(...skipping 18 matching lines...) Expand all Loading... |
176 | 183 |
177 // This graphics device will be is_null() if no graphics has been manually | 184 // This graphics device will be is_null() if no graphics has been manually |
178 // set yet. | 185 // set yet. |
179 pp::Graphics2D graphics_; | 186 pp::Graphics2D graphics_; |
180 | 187 |
181 PaintAggregator aggregator_; | 188 PaintAggregator aggregator_; |
182 | 189 |
183 // See comment for EnsureCallbackPending for more on how these work. | 190 // See comment for EnsureCallbackPending for more on how these work. |
184 bool manual_callback_pending_; | 191 bool manual_callback_pending_; |
185 bool flush_pending_; | 192 bool flush_pending_; |
| 193 bool flush_requested_; |
186 | 194 |
187 // When we get a resize, we don't bind right away (see SetSize). The | 195 // When we get a resize, we don't bind right away (see SetSize). The |
188 // has_pending_resize_ tells us that we need to do a resize for the next | 196 // has_pending_resize_ tells us that we need to do a resize for the next |
189 // paint operation. When true, the new size is in pending_size_. | 197 // paint operation. When true, the new size is in pending_size_. |
190 bool has_pending_resize_; | 198 bool has_pending_resize_; |
191 bool graphics_need_to_be_bound_; | 199 bool graphics_need_to_be_bound_; |
192 pp::Size pending_size_; | 200 pp::Size pending_size_; |
193 pp::Size plugin_size_; | 201 pp::Size plugin_size_; |
194 float pending_device_scale_; | 202 float pending_device_scale_; |
195 float device_scale_; | 203 float device_scale_; |
196 | 204 |
197 // True iff we're in the middle of a paint. | 205 // True iff we're in the middle of a paint. |
198 bool in_paint_; | 206 bool in_paint_; |
199 | 207 |
200 // True if we haven't painted the plugin viewport yet. | 208 // True if we haven't painted the plugin viewport yet. |
201 bool first_paint_; | 209 bool first_paint_; |
202 | 210 |
203 // True when the view size just changed and we're waiting for a paint. | 211 // True when the view size just changed and we're waiting for a paint. |
204 bool view_size_changed_waiting_for_paint_; | 212 bool view_size_changed_waiting_for_paint_; |
205 }; | 213 }; |
206 | 214 |
207 #endif // PDF_PAINT_MANAGER_H_ | 215 #endif // PDF_PAINT_MANAGER_H_ |
OLD | NEW |