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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 | 109 |
110 // Returns the size of the graphics context to allocate for a given plugin | 110 // Returns the size of the graphics context to allocate for a given plugin |
111 // size. We may allocated a slightly larger buffer than required so that we | 111 // size. We may allocated a slightly larger buffer than required so that we |
112 // don't have to resize the context when scrollbars appear/dissapear due to | 112 // don't have to resize the context when scrollbars appear/dissapear due to |
113 // zooming (which can result in flickering). | 113 // zooming (which can result in flickering). |
114 static pp::Size GetNewContextSize(const pp::Size& current_context_size, | 114 static pp::Size GetNewContextSize(const pp::Size& current_context_size, |
115 const pp::Size& plugin_size); | 115 const pp::Size& plugin_size); |
116 | 116 |
117 // You must call this function before using if you use the 0-arg constructor. | 117 // You must call this function before using if you use the 0-arg constructor. |
118 // See the constructor for what these arguments mean. | 118 // See the constructor for what these arguments mean. |
119 void Initialize(pp::Instance* instance, Client* client, | 119 void Initialize(pp::Instance* instance, |
| 120 Client* client, |
120 bool is_always_opaque); | 121 bool is_always_opaque); |
121 | 122 |
122 // Sets the size of the plugin. If the size is the same as the previous call, | 123 // Sets the size of the plugin. If the size is the same as the previous call, |
123 // this will be a NOP. If the size has changed, a new device will be | 124 // this will be a NOP. If the size has changed, a new device will be |
124 // allocated to the given size and a paint to that device will be scheduled. | 125 // allocated to the given size and a paint to that device will be scheduled. |
125 // | 126 // |
126 // This is intended to be called from ViewChanged with the size of the | 127 // This is intended to be called from ViewChanged with the size of the |
127 // plugin. Since it tracks the old size and only allocates when the size | 128 // plugin. Since it tracks the old size and only allocates when the size |
128 // changes, you can always call this function without worrying about whether | 129 // changes, you can always call this function without worrying about whether |
129 // the size changed or ViewChanged is called for another reason (like the | 130 // the size changed or ViewChanged is called for another reason (like the |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 bool in_paint_; | 217 bool in_paint_; |
217 | 218 |
218 // True if we haven't painted the plugin viewport yet. | 219 // True if we haven't painted the plugin viewport yet. |
219 bool first_paint_; | 220 bool first_paint_; |
220 | 221 |
221 // True when the view size just changed and we're waiting for a paint. | 222 // True when the view size just changed and we're waiting for a paint. |
222 bool view_size_changed_waiting_for_paint_; | 223 bool view_size_changed_waiting_for_paint_; |
223 }; | 224 }; |
224 | 225 |
225 #endif // PDF_PAINT_MANAGER_H_ | 226 #endif // PDF_PAINT_MANAGER_H_ |
OLD | NEW |