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

Unified Diff: content/browser/renderer_host/render_widget_host_view_gtk.cc

Issue 10735010: 3D Compositing in <browser>, first draft. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/render_widget_host_view_gtk.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_gtk.cc b/content/browser/renderer_host/render_widget_host_view_gtk.cc
index 43588272859094befc61962906218aba5b10ca94..22a1c9eae2310c8311afe9c5a25a46e9531b67c2 100644
--- a/content/browser/renderer_host/render_widget_host_view_gtk.cc
+++ b/content/browser/renderer_host/render_widget_host_view_gtk.cc
@@ -567,7 +567,8 @@ class RenderWidgetHostViewGtkWidget {
RenderWidgetHostViewGtk::RenderWidgetHostViewGtk(
content::RenderWidgetHost* widget_host)
- : host_(RenderWidgetHostImpl::From(widget_host)),
+ : RenderWidgetHostViewBase(scoped_ptr<CompositingDelegate> (new CompositingDelegateGtk(this)).Pass()),
+ host_(RenderWidgetHostImpl::From(widget_host)),
about_to_validate_and_paint_(false),
is_hidden_(false),
is_loading_(false),
@@ -1026,14 +1027,14 @@ void RenderWidgetHostViewGtk::CopyFromCompositingSurface(
callback.Run(false);
}
-void RenderWidgetHostViewGtk::AcceleratedSurfaceBuffersSwapped(
+void RenderWidgetHostViewGtk::CompositingDelegateGtk::AcceleratedSurfaceBuffersSwapped(
const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params,
int gpu_host_id) {
RenderWidgetHostImpl::AcknowledgeBufferPresent(
params.route_id, gpu_host_id, 0);
}
-void RenderWidgetHostViewGtk::AcceleratedSurfacePostSubBuffer(
+void RenderWidgetHostViewGtk::CompositingDelegateGtk::AcceleratedSurfacePostSubBuffer(
const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params,
int gpu_host_id) {
RenderWidgetHostImpl::AcknowledgeBufferPresent(
@@ -1248,18 +1249,6 @@ gfx::Rect RenderWidgetHostViewGtk::GetRootWindowBounds() {
frame_extents.width, frame_extents.height);
}
-gfx::GLSurfaceHandle RenderWidgetHostViewGtk::GetCompositingSurface() {
- if (compositing_surface_ == gfx::kNullPluginWindow) {
- GtkNativeViewManager* manager = GtkNativeViewManager::GetInstance();
- gfx::NativeViewId view_id = GetNativeViewId();
-
- if (!manager->GetPermanentXIDForId(&compositing_surface_, view_id)) {
- DLOG(ERROR) << "Can't find XID for view id " << view_id;
- }
- }
- return gfx::GLSurfaceHandle(compositing_surface_, true);
-}
-
bool RenderWidgetHostViewGtk::LockMouse() {
if (mouse_locked_)
return true;
@@ -1516,3 +1505,24 @@ AtkObject* RenderWidgetHostViewGtk::GetAccessible() {
atk_object_set_role(root->GetAtkObject(), ATK_ROLE_HTML_CONTAINER);
return root->GetAtkObject();
}
+
+////////////////////////////////////////////////////////////////////////////////
+// CompositingDelegateGtk
+
+gfx::GLSurfaceHandle
+RenderWidgetHostViewGtk::CompositingDelegateGtk::GetCompositingSurface() {
+ if (view_->compositing_surface_ == gfx::kNullPluginWindow) {
+ GtkNativeViewManager* manager = GtkNativeViewManager::GetInstance();
+ gfx::NativeViewId view_id = view_->GetNativeViewId();
+
+ if (!manager->GetPermanentXIDForId(&view_->compositing_surface_, view_id)) {
+ DLOG(ERROR) << "Can't find XID for view id " << view_id;
+ }
+ }
+ return gfx::GLSurfaceHandle(view_->compositing_surface_, true);
+}
+
+bool
+RenderWidgetHostViewGtk::CompositingDelegateGtk::ResizeNeedsNewSurface() {
+ return true;
+}

Powered by Google App Engine
This is Rietveld 408576698