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

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

Issue 10823378: Cache image data objects. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 virtual void LastPluginRefWasDeleted() OVERRIDE; 44 virtual void LastPluginRefWasDeleted() OVERRIDE;
45 45
46 // PPB_Graphics2D functions. 46 // PPB_Graphics2D functions.
47 virtual PP_Bool Describe(PP_Size* size, PP_Bool* is_always_opaque) OVERRIDE; 47 virtual PP_Bool Describe(PP_Size* size, PP_Bool* is_always_opaque) OVERRIDE;
48 virtual void PaintImageData(PP_Resource image_data, 48 virtual void PaintImageData(PP_Resource image_data,
49 const PP_Point* top_left, 49 const PP_Point* top_left,
50 const PP_Rect* src_rect) OVERRIDE; 50 const PP_Rect* src_rect) OVERRIDE;
51 virtual void Scroll(const PP_Rect* clip_rect, 51 virtual void Scroll(const PP_Rect* clip_rect,
52 const PP_Point* amount) OVERRIDE; 52 const PP_Point* amount) OVERRIDE;
53 virtual void ReplaceContents(PP_Resource image_data) OVERRIDE; 53 virtual void ReplaceContents(PP_Resource image_data) OVERRIDE;
54 virtual int32_t Flush(
55 scoped_refptr< ::ppapi::TrackedCallback> callback) OVERRIDE;
56 virtual bool SetScale(float scale) OVERRIDE; 54 virtual bool SetScale(float scale) OVERRIDE;
57 virtual float GetScale() OVERRIDE; 55 virtual float GetScale() OVERRIDE;
56 virtual int32_t Flush(
57 scoped_refptr< ::ppapi::TrackedCallback> callback,
58 PP_Resource* old_image_data) OVERRIDE;
58 59
59 bool ReadImageData(PP_Resource image, const PP_Point* top_left); 60 bool ReadImageData(PP_Resource image, const PP_Point* top_left);
60 61
61 // Assciates this device with the given plugin instance. You can pass NULL to 62 // Assciates this device with the given plugin instance. You can pass NULL to
62 // clear the existing device. Returns true on success. In this case, a 63 // clear the existing device. Returns true on success. In this case, a
63 // repaint of the page will also be scheduled. Failure means that the device 64 // repaint of the page will also be scheduled. Failure means that the device
64 // is already bound to a different instance, and nothing will happen. 65 // is already bound to a different instance, and nothing will happen.
65 bool BindToInstance(PluginInstance* new_instance); 66 bool BindToInstance(PluginInstance* new_instance);
66 67
67 // Paints the current backing store to the web page. 68 // Paints the current backing store to the web page.
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 // rect argument will be filled by each function with the area affected by 136 // rect argument will be filled by each function with the area affected by
136 // the update that requires invalidation. If there were no pixels changed, 137 // the update that requires invalidation. If there were no pixels changed,
137 // this rect can be untouched. 138 // this rect can be untouched.
138 void ExecutePaintImageData(PPB_ImageData_Impl* image, 139 void ExecutePaintImageData(PPB_ImageData_Impl* image,
139 int x, int y, 140 int x, int y,
140 const gfx::Rect& src_rect, 141 const gfx::Rect& src_rect,
141 gfx::Rect* invalidated_rect); 142 gfx::Rect* invalidated_rect);
142 void ExecuteScroll(const gfx::Rect& clip, int dx, int dy, 143 void ExecuteScroll(const gfx::Rect& clip, int dx, int dy,
143 gfx::Rect* invalidated_rect); 144 gfx::Rect* invalidated_rect);
144 void ExecuteReplaceContents(PPB_ImageData_Impl* image, 145 void ExecuteReplaceContents(PPB_ImageData_Impl* image,
145 gfx::Rect* invalidated_rect); 146 gfx::Rect* invalidated_rect,
147 PP_Resource* old_image_data);
146 148
147 // Schedules the offscreen callback to be fired at a future time. This 149 // Schedules the offscreen callback to be fired at a future time. This
148 // will add the given item to the offscreen_flush_callbacks_ vector. 150 // will add the given item to the offscreen_flush_callbacks_ vector.
149 void ScheduleOffscreenCallback(const FlushCallbackData& callback); 151 void ScheduleOffscreenCallback(const FlushCallbackData& callback);
150 152
151 // Function scheduled to execute by ScheduleOffscreenCallback that actually 153 // Function scheduled to execute by ScheduleOffscreenCallback that actually
152 // issues the offscreen callbacks. 154 // issues the offscreen callbacks.
153 void ExecuteOffscreenCallback(FlushCallbackData data); 155 void ExecuteOffscreenCallback(FlushCallbackData data);
154 156
155 // Returns true if there is any type of flush callback pending. 157 // Returns true if there is any type of flush callback pending.
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 206
205 base::WeakPtrFactory<PPB_Graphics2D_Impl> weak_ptr_factory_; 207 base::WeakPtrFactory<PPB_Graphics2D_Impl> weak_ptr_factory_;
206 208
207 DISALLOW_COPY_AND_ASSIGN(PPB_Graphics2D_Impl); 209 DISALLOW_COPY_AND_ASSIGN(PPB_Graphics2D_Impl);
208 }; 210 };
209 211
210 } // namespace ppapi 212 } // namespace ppapi
211 } // namespace webkit 213 } // namespace webkit
212 214
213 #endif // WEBKIT_PLUGINS_PPAPI_PPB_GRAPHICS_2D_IMPL_H_ 215 #endif // WEBKIT_PLUGINS_PPAPI_PPB_GRAPHICS_2D_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698