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

Side by Side Diff: webkit/plugins/ppapi/ppb_graphics_2d_impl.h

Issue 10544168: Implement HiDPI support in Pepper dev interface (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add comments to Graphics2DDev C++ header Created 8 years, 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 WEBKIT_PLUGINS_PPAPI_PPB_GRAPHICS_2D_IMPL_H_ 5 #ifndef WEBKIT_PLUGINS_PPAPI_PPB_GRAPHICS_2D_IMPL_H_
6 #define WEBKIT_PLUGINS_PPAPI_PPB_GRAPHICS_2D_IMPL_H_ 6 #define WEBKIT_PLUGINS_PPAPI_PPB_GRAPHICS_2D_IMPL_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 43
44 // PPB_Graphics2D functions. 44 // PPB_Graphics2D functions.
45 virtual PP_Bool Describe(PP_Size* size, PP_Bool* is_always_opaque) OVERRIDE; 45 virtual PP_Bool Describe(PP_Size* size, PP_Bool* is_always_opaque) OVERRIDE;
46 virtual void PaintImageData(PP_Resource image_data, 46 virtual void PaintImageData(PP_Resource image_data,
47 const PP_Point* top_left, 47 const PP_Point* top_left,
48 const PP_Rect* src_rect) OVERRIDE; 48 const PP_Rect* src_rect) OVERRIDE;
49 virtual void Scroll(const PP_Rect* clip_rect, 49 virtual void Scroll(const PP_Rect* clip_rect,
50 const PP_Point* amount) OVERRIDE; 50 const PP_Point* amount) OVERRIDE;
51 virtual void ReplaceContents(PP_Resource image_data) OVERRIDE; 51 virtual void ReplaceContents(PP_Resource image_data) OVERRIDE;
52 virtual int32_t Flush(PP_CompletionCallback callback) OVERRIDE; 52 virtual int32_t Flush(PP_CompletionCallback callback) OVERRIDE;
53 virtual bool SetScale(float scale) OVERRIDE;
54 virtual float GetScale() OVERRIDE { return scale_; }
brettw 2012/06/19 20:21:27 No inline virtual functions. This should throw an
Josh Horwich 2012/06/19 23:56:15 Done. (Clang didn't complain, FWIW, but I moved i
53 55
54 bool ReadImageData(PP_Resource image, const PP_Point* top_left); 56 bool ReadImageData(PP_Resource image, const PP_Point* top_left);
55 57
56 // Assciates this device with the given plugin instance. You can pass NULL to 58 // Assciates this device with the given plugin instance. You can pass NULL to
57 // clear the existing device. Returns true on success. In this case, a 59 // clear the existing device. Returns true on success. In this case, a
58 // repaint of the page will also be scheduled. Failure means that the device 60 // repaint of the page will also be scheduled. Failure means that the device
59 // is already bound to a different instance, and nothing will happen. 61 // is already bound to a different instance, and nothing will happen.
60 bool BindToInstance(PluginInstance* new_instance); 62 bool BindToInstance(PluginInstance* new_instance);
61 63
62 // Paints the current backing store to the web page. 64 // Paints the current backing store to the web page.
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 179
178 // When doing offscreen flushes, we issue a task that issues the callback 180 // When doing offscreen flushes, we issue a task that issues the callback
179 // later. This is set when one of those tasks is pending so that we can 181 // later. This is set when one of those tasks is pending so that we can
180 // enforce the "only one pending flush at a time" constraint in the API. 182 // enforce the "only one pending flush at a time" constraint in the API.
181 bool offscreen_flush_pending_; 183 bool offscreen_flush_pending_;
182 184
183 // Set to true if the plugin declares that this device will always be opaque. 185 // Set to true if the plugin declares that this device will always be opaque.
184 // This allows us to do more optimized painting in some cases. 186 // This allows us to do more optimized painting in some cases.
185 bool is_always_opaque_; 187 bool is_always_opaque_;
186 188
189 // Set to the scale between what the plugin considers to be one pixel and one
190 // DIP
191 float scale_;
192
187 base::WeakPtrFactory<PPB_Graphics2D_Impl> weak_ptr_factory_; 193 base::WeakPtrFactory<PPB_Graphics2D_Impl> weak_ptr_factory_;
188 194
189 DISALLOW_COPY_AND_ASSIGN(PPB_Graphics2D_Impl); 195 DISALLOW_COPY_AND_ASSIGN(PPB_Graphics2D_Impl);
190 }; 196 };
191 197
192 } // namespace ppapi 198 } // namespace ppapi
193 } // namespace webkit 199 } // namespace webkit
194 200
195 #endif // WEBKIT_PLUGINS_PPAPI_PPB_GRAPHICS_2D_IMPL_H_ 201 #endif // WEBKIT_PLUGINS_PPAPI_PPB_GRAPHICS_2D_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698