| OLD | NEW |
| 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" |
| 11 #include "base/memory/ref_counted.h" |
| 11 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
| 12 #include "ppapi/c/pp_completion_callback.h" | 13 #include "ppapi/c/pp_completion_callback.h" |
| 13 #include "ppapi/c/ppb_graphics_2d.h" | 14 #include "ppapi/c/ppb_graphics_2d.h" |
| 14 #include "ppapi/shared_impl/resource.h" | 15 #include "ppapi/shared_impl/resource.h" |
| 15 #include "ppapi/shared_impl/tracked_callback.h" | 16 #include "ppapi/shared_impl/tracked_callback.h" |
| 16 #include "ppapi/thunk/ppb_graphics_2d_api.h" | 17 #include "ppapi/thunk/ppb_graphics_2d_api.h" |
| 17 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebCanvas.h" | 18 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebCanvas.h" |
| 18 | 19 |
| 19 namespace gfx { | 20 namespace gfx { |
| 20 class Rect; | 21 class Rect; |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 | 108 |
| 108 private: | 109 private: |
| 109 scoped_refptr< ::ppapi::TrackedCallback> callback_; | 110 scoped_refptr< ::ppapi::TrackedCallback> callback_; |
| 110 }; | 111 }; |
| 111 | 112 |
| 112 // Called internally to execute the different queued commands. The | 113 // Called internally to execute the different queued commands. The |
| 113 // parameters to these functions will have already been validated. The last | 114 // parameters to these functions will have already been validated. The last |
| 114 // rect argument will be filled by each function with the area affected by | 115 // rect argument will be filled by each function with the area affected by |
| 115 // the update that requires invalidation. If there were no pixels changed, | 116 // the update that requires invalidation. If there were no pixels changed, |
| 116 // this rect can be untouched. | 117 // this rect can be untouched. |
| 117 void ExecutePaintImageData(PPB_ImageData_Impl* image, | 118 void ExecutePaintImageData(scoped_refptr<PPB_ImageData_Impl> image, |
| 118 int x, int y, | 119 int x, int y, |
| 119 const gfx::Rect& src_rect, | 120 const gfx::Rect& src_rect, |
| 120 gfx::Rect* invalidated_rect); | 121 gfx::Rect* invalidated_rect); |
| 121 void ExecuteScroll(const gfx::Rect& clip, int dx, int dy, | 122 void ExecuteScroll(const gfx::Rect& clip, int dx, int dy, |
| 122 gfx::Rect* invalidated_rect); | 123 gfx::Rect* invalidated_rect); |
| 123 void ExecuteReplaceContents(PPB_ImageData_Impl* image, | 124 void ExecuteReplaceContents(scoped_refptr<PPB_ImageData_Impl> image, |
| 124 gfx::Rect* invalidated_rect); | 125 gfx::Rect* invalidated_rect); |
| 125 | 126 |
| 126 // Schedules the offscreen callback to be fired at a future time. This | 127 // Schedules the offscreen callback to be fired at a future time. This |
| 127 // will add the given item to the offscreen_flush_callbacks_ vector. | 128 // will add the given item to the offscreen_flush_callbacks_ vector. |
| 128 void ScheduleOffscreenCallback(const FlushCallbackData& callback); | 129 void ScheduleOffscreenCallback(const FlushCallbackData& callback); |
| 129 | 130 |
| 130 // Function scheduled to execute by ScheduleOffscreenCallback that actually | 131 // Function scheduled to execute by ScheduleOffscreenCallback that actually |
| 131 // issues the offscreen callbacks. | 132 // issues the offscreen callbacks. |
| 132 void ExecuteOffscreenCallback(FlushCallbackData data); | 133 void ExecuteOffscreenCallback(FlushCallbackData data); |
| 133 | 134 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 | 179 |
| 179 base::WeakPtrFactory<PPB_Graphics2D_Impl> weak_ptr_factory_; | 180 base::WeakPtrFactory<PPB_Graphics2D_Impl> weak_ptr_factory_; |
| 180 | 181 |
| 181 DISALLOW_COPY_AND_ASSIGN(PPB_Graphics2D_Impl); | 182 DISALLOW_COPY_AND_ASSIGN(PPB_Graphics2D_Impl); |
| 182 }; | 183 }; |
| 183 | 184 |
| 184 } // namespace ppapi | 185 } // namespace ppapi |
| 185 } // namespace webkit | 186 } // namespace webkit |
| 186 | 187 |
| 187 #endif // WEBKIT_PLUGINS_PPAPI_PPB_GRAPHICS_2D_IMPL_H_ | 188 #endif // WEBKIT_PLUGINS_PPAPI_PPB_GRAPHICS_2D_IMPL_H_ |
| OLD | NEW |