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

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

Issue 10352016: Consolidate RenderWidgetHost::CopyFromBackingStore and RenderWidgetHost::AsyncCopyFromBackingStore. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 7 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
« no previous file with comments | « content/port/browser/render_widget_host_view_port.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #pragma once 7 #pragma once
8 8
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "content/common/content_export.h" 10 #include "content/common/content_export.h"
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 // Once we cancel updating the text direction, we have to ignore all 156 // Once we cancel updating the text direction, we have to ignore all
157 // succeeding UpdateTextDirection() requests until calling 157 // succeeding UpdateTextDirection() requests until calling
158 // NotifyTextDirection(). (We may receive keydown events even after we 158 // NotifyTextDirection(). (We may receive keydown events even after we
159 // canceled updating the text direction because of auto-repeat.) 159 // canceled updating the text direction because of auto-repeat.)
160 // Note: we cannot undo this change for compatibility with Firefox and IE. 160 // Note: we cannot undo this change for compatibility with Firefox and IE.
161 virtual void UpdateTextDirection(WebKit::WebTextDirection direction) = 0; 161 virtual void UpdateTextDirection(WebKit::WebTextDirection direction) = 0;
162 virtual void NotifyTextDirection() = 0; 162 virtual void NotifyTextDirection() = 0;
163 163
164 virtual void Blur() = 0; 164 virtual void Blur() = 0;
165 165
166 // DEPRECATED: Synchronous version of AsyncCopyFromBackingSurface.
167 // This will be removed once all the caller have been changed to use the
168 // asynchronous version.
169 virtual bool CopyFromBackingStore(const gfx::Rect& src_rect,
170 const gfx::Size& accelerated_dest_size,
171 skia::PlatformCanvas* output) = 0;
172
173 // Copies the given subset of the backing store into the given (uninitialized) 166 // Copies the given subset of the backing store into the given (uninitialized)
174 // PlatformCanvas. If |src_rect| is empty, the whole contents is copied. 167 // PlatformCanvas. If |src_rect| is empty, the whole contents is copied.
175 // |callback| is invoked with true on success, false otherwise. |output| can 168 // NOTE: |src_rect| is not supported yet when accelerated compositing is
176 // be initialized even on failure. 169 // active (http://crbug.com/118571) and the whole content is always copied
177 // When accelerated compositing is active, the contents is copied 170 // regardless of |src_rect|.
178 // asynchronously from the compositing surface, but when the backing store is
179 // available, the contents is copied synchronously because it's fast enough.
180 // If non empty |accelerated_dest_size| is given and accelerated compositing 171 // If non empty |accelerated_dest_size| is given and accelerated compositing
181 // is active, the content is shrinked so that it fits in 172 // is active, the content is shrinked so that it fits in
182 // |accelerated_dest_size|. If |accelerated_dest_size| is larger than the 173 // |accelerated_dest_size|. If |accelerated_dest_size| is larger than the
183 // contens size, the content is not resized. If |accelerated_dest_size| is 174 // contens size, the content is not resized. If |accelerated_dest_size| is
184 // empty, the size copied from the source contents is used. 175 // empty, the size copied from the source contents is used.
185 // NOTE: |src_rect| is not supported yet when accelerated compositing is 176 // |callback| is invoked with true on success, false otherwise. |output| can
186 // active (http://crbug.com/118571) and the whole content is always copied 177 // be initialized even on failure.
187 // regardless of |src_rect|. 178 // NOTE: |callback| is called synchronously if the backing store is available.
188 virtual void AsyncCopyFromBackingStore( 179 // When accelerated compositing is active, it is called asynchronously on Aura
189 const gfx::Rect& src_rect, 180 // and synchronously on the other platforms.
190 const gfx::Size& accelerated_dest_size, 181 virtual void CopyFromBackingStore(const gfx::Rect& src_rect,
191 skia::PlatformCanvas* output, 182 const gfx::Size& accelerated_dest_size,
192 base::Callback<void(bool)> callback) = 0; 183 skia::PlatformCanvas* output,
184 base::Callback<void(bool)> callback) = 0;
193 #if defined(TOOLKIT_GTK) 185 #if defined(TOOLKIT_GTK)
194 // Paint the backing store into the target's |dest_rect|. 186 // Paint the backing store into the target's |dest_rect|.
195 virtual bool CopyFromBackingStoreToGtkWindow(const gfx::Rect& dest_rect, 187 virtual bool CopyFromBackingStoreToGtkWindow(const gfx::Rect& dest_rect,
196 GdkWindow* target) = 0; 188 GdkWindow* target) = 0;
197 #elif defined(OS_MACOSX) 189 #elif defined(OS_MACOSX)
198 virtual gfx::Size GetBackingStoreSize() = 0; 190 virtual gfx::Size GetBackingStoreSize() = 0;
199 virtual bool CopyFromBackingStoreToCGContext(const CGRect& dest_rect, 191 virtual bool CopyFromBackingStoreToCGContext(const CGRect& dest_rect,
200 CGContextRef target) = 0; 192 CGContextRef target) = 0;
201 #endif 193 #endif
202 194
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 // within content/. This method is necessary because 277 // within content/. This method is necessary because
286 // RenderWidgetHost is the root of a diamond inheritance pattern, so 278 // RenderWidgetHost is the root of a diamond inheritance pattern, so
287 // subclasses inherit it virtually, which removes our ability to 279 // subclasses inherit it virtually, which removes our ability to
288 // static_cast to the subclass. 280 // static_cast to the subclass.
289 virtual RenderWidgetHostImpl* AsRenderWidgetHostImpl() = 0; 281 virtual RenderWidgetHostImpl* AsRenderWidgetHostImpl() = 0;
290 }; 282 };
291 283
292 } // namespace content 284 } // namespace content
293 285
294 #endif // CONTENT_PUBLIC_BROWSER_RENDER_WIDGET_HOST_H_ 286 #endif // CONTENT_PUBLIC_BROWSER_RENDER_WIDGET_HOST_H_
OLDNEW
« no previous file with comments | « content/port/browser/render_widget_host_view_port.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698