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 CONTENT_PUBLIC_BROWSER_RENDER_WIDGET_HOST_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_RENDER_WIDGET_HOST_H_ |
6 #define CONTENT_PUBLIC_BROWSER_RENDER_WIDGET_HOST_H_ | 6 #define CONTENT_PUBLIC_BROWSER_RENDER_WIDGET_HOST_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "content/common/content_export.h" | 9 #include "content/common/content_export.h" |
10 #include "content/public/browser/native_web_keyboard_event.h" | 10 #include "content/public/browser/native_web_keyboard_event.h" |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 // source contents is used. |callback| is invoked with true on success, false | 193 // source contents is used. |callback| is invoked with true on success, false |
194 // otherwise, along with a SkBitmap containing the copied pixel data. | 194 // otherwise, along with a SkBitmap containing the copied pixel data. |
195 // | 195 // |
196 // NOTE: |callback| is called synchronously if the backing store is available. | 196 // NOTE: |callback| is called synchronously if the backing store is available. |
197 // When accelerated compositing is active, |callback| may be called | 197 // When accelerated compositing is active, |callback| may be called |
198 // asynchronously. | 198 // asynchronously. |
199 virtual void CopyFromBackingStore( | 199 virtual void CopyFromBackingStore( |
200 const gfx::Rect& src_rect, | 200 const gfx::Rect& src_rect, |
201 const gfx::Size& accelerated_dst_size, | 201 const gfx::Size& accelerated_dst_size, |
202 const base::Callback<void(bool, const SkBitmap&)>& callback) = 0; | 202 const base::Callback<void(bool, const SkBitmap&)>& callback) = 0; |
| 203 virtual bool CanCopyFromBackingStore() = 0; |
| 204 virtual void LockForCopyFromBackingStore() = 0; |
| 205 virtual void UnlockForCopyFromBackingStore() = 0; |
203 #if defined(TOOLKIT_GTK) | 206 #if defined(TOOLKIT_GTK) |
204 // Paint the backing store into the target's |dest_rect|. | 207 // Paint the backing store into the target's |dest_rect|. |
205 virtual bool CopyFromBackingStoreToGtkWindow(const gfx::Rect& dest_rect, | 208 virtual bool CopyFromBackingStoreToGtkWindow(const gfx::Rect& dest_rect, |
206 GdkWindow* target) = 0; | 209 GdkWindow* target) = 0; |
207 #elif defined(OS_MACOSX) | 210 #elif defined(OS_MACOSX) |
208 virtual gfx::Size GetBackingStoreSize() = 0; | 211 virtual gfx::Size GetBackingStoreSize() = 0; |
209 virtual bool CopyFromBackingStoreToCGContext(const CGRect& dest_rect, | 212 virtual bool CopyFromBackingStoreToCGContext(const CGRect& dest_rect, |
210 CGContextRef target) = 0; | 213 CGContextRef target) = 0; |
211 #endif | 214 #endif |
212 | 215 |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 // within content/. This method is necessary because | 306 // within content/. This method is necessary because |
304 // RenderWidgetHost is the root of a diamond inheritance pattern, so | 307 // RenderWidgetHost is the root of a diamond inheritance pattern, so |
305 // subclasses inherit it virtually, which removes our ability to | 308 // subclasses inherit it virtually, which removes our ability to |
306 // static_cast to the subclass. | 309 // static_cast to the subclass. |
307 virtual RenderWidgetHostImpl* AsRenderWidgetHostImpl() = 0; | 310 virtual RenderWidgetHostImpl* AsRenderWidgetHostImpl() = 0; |
308 }; | 311 }; |
309 | 312 |
310 } // namespace content | 313 } // namespace content |
311 | 314 |
312 #endif // CONTENT_PUBLIC_BROWSER_RENDER_WIDGET_HOST_H_ | 315 #endif // CONTENT_PUBLIC_BROWSER_RENDER_WIDGET_HOST_H_ |
OLD | NEW |