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

Side by Side Diff: content/public/browser/render_widget_host.h

Issue 12881005: Allow CopyFromBackingStore to fallback to copying from the renderer side if the accelerated surface… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fallback to renderer side copy when backing store is not avilable too Created 7 years, 9 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
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 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/keyboard_listener.h" 10 #include "content/public/browser/keyboard_listener.h"
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 // bitmap to a callback. 176 // bitmap to a callback.
177 // 177 //
178 // If |src_rect| is empty, the whole contents is copied. If non empty 178 // If |src_rect| is empty, the whole contents is copied. If non empty
179 // |accelerated_dst_size| is given and accelerated compositing is active, the 179 // |accelerated_dst_size| is given and accelerated compositing is active, the
180 // content is shrunk so that it fits in |accelerated_dst_size|. If 180 // content is shrunk so that it fits in |accelerated_dst_size|. If
181 // |accelerated_dst_size| is larger than the content size, the content is not 181 // |accelerated_dst_size| is larger than the content size, the content is not
182 // resized. If |accelerated_dst_size| is empty, the size copied from the 182 // resized. If |accelerated_dst_size| is empty, the size copied from the
183 // source contents is used. |callback| is invoked with true on success, false 183 // source contents is used. |callback| is invoked with true on success, false
184 // otherwise, along with a SkBitmap containing the copied pixel data. 184 // otherwise, along with a SkBitmap containing the copied pixel data.
185 // 185 //
186 // If the backing store is not available or, in composited mode, the
187 // accelerated surface is not available to the browser, then the copy is done
188 // on the renderer side via IPC.
189 //
186 // NOTE: |callback| is called synchronously if the backing store is available. 190 // NOTE: |callback| is called synchronously if the backing store is available.
187 // When accelerated compositing is active, |callback| may be called 191 // When accelerated compositing is active, |callback| may be called
188 // asynchronously. 192 // asynchronously.
189 virtual void CopyFromBackingStore( 193 virtual void CopyFromBackingStore(
190 const gfx::Rect& src_rect, 194 const gfx::Rect& src_rect,
191 const gfx::Size& accelerated_dst_size, 195 const gfx::Size& accelerated_dst_size,
192 const base::Callback<void(bool, const SkBitmap&)>& callback) = 0; 196 const base::Callback<void(bool, const SkBitmap&)>& callback) = 0;
193 #if defined(TOOLKIT_GTK) 197 #if defined(TOOLKIT_GTK)
194 // Paint the backing store into the target's |dest_rect|. 198 // Paint the backing store into the target's |dest_rect|.
195 virtual bool CopyFromBackingStoreToGtkWindow(const gfx::Rect& dest_rect, 199 virtual bool CopyFromBackingStoreToGtkWindow(const gfx::Rect& dest_rect,
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 // within content/. This method is necessary because 295 // within content/. This method is necessary because
292 // RenderWidgetHost is the root of a diamond inheritance pattern, so 296 // RenderWidgetHost is the root of a diamond inheritance pattern, so
293 // subclasses inherit it virtually, which removes our ability to 297 // subclasses inherit it virtually, which removes our ability to
294 // static_cast to the subclass. 298 // static_cast to the subclass.
295 virtual RenderWidgetHostImpl* AsRenderWidgetHostImpl() = 0; 299 virtual RenderWidgetHostImpl* AsRenderWidgetHostImpl() = 0;
296 }; 300 };
297 301
298 } // namespace content 302 } // namespace content
299 303
300 #endif // CONTENT_PUBLIC_BROWSER_RENDER_WIDGET_HOST_H_ 304 #endif // CONTENT_PUBLIC_BROWSER_RENDER_WIDGET_HOST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698