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

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

Issue 23653049: (not for review) Fix composited-to-non-composited corruption on Linux. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_gtk.h ('k') | content/common/gpu/gpu_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1fe5d4c3e54070707a1b091f05efc165ce15b2f1..d8692d69500905ef663a5b5b23d257cb0dc0ac73 100644
--- a/content/browser/renderer_host/render_widget_host_view_gtk.cc
+++ b/content/browser/renderer_host/render_widget_host_view_gtk.cc
@@ -4,12 +4,6 @@
#include "content/browser/renderer_host/render_widget_host_view_gtk.h"
-#include <cairo/cairo.h>
-#include <gdk/gdk.h>
-#include <gdk/gdkkeysyms.h>
-#include <gdk/gdkx.h>
-#include <gtk/gtk.h>
-
#include <algorithm>
#include <string>
@@ -25,6 +19,8 @@
#include "base/time/time.h"
#include "content/browser/accessibility/browser_accessibility_gtk.h"
#include "content/browser/accessibility/browser_accessibility_manager_gtk.h"
+#include "content/browser/gpu/gpu_process_host.h"
+#include "content/browser/gpu/gpu_process_host_ui_shim.h"
#include "content/browser/renderer_host/backing_store_gtk.h"
#include "content/browser/renderer_host/gtk_im_context_wrapper.h"
#include "content/browser/renderer_host/gtk_key_bindings_handler.h"
@@ -50,6 +46,12 @@
#include "ui/gfx/text_elider.h"
#include "webkit/common/cursors/webcursor_gtk_data.h"
+#include <cairo/cairo.h>
+#include <gdk/gdk.h>
+#include <gdk/gdkkeysyms.h>
+#include <gdk/gdkx.h>
+#include <gtk/gtk.h>
+
using WebKit::WebMouseWheelEvent;
using WebKit::WebScreenInfo;
@@ -554,6 +556,7 @@ RenderWidgetHostViewGtk::RenderWidgetHostViewGtk(RenderWidgetHost* widget_host)
dragged_at_horizontal_edge_(0),
dragged_at_vertical_edge_(0),
compositing_surface_(gfx::kNullPluginWindow),
+ last_frame_was_composited_(false),
last_mouse_down_(NULL) {
host_->SetView(this);
if (host_->is_hidden())
@@ -1067,6 +1070,17 @@ void RenderWidgetHostViewGtk::AcceleratedSurfaceBuffersSwapped(
RenderWidgetHostImpl::AcknowledgeBufferPresent(
params.route_id, gpu_host_id, ack_params);
host_->FrameSwapped(params.latency_info);
+
+ if (!last_frame_was_composited_ &&
+ compositing_surface_ != gfx::kNullPluginWindow) {
+ GpuProcessHostUIShim* host = GpuProcessHostUIShim::GetOneInstance();
+ int32 surface_id = compositing_surface_;
+ if (host) {
+ bool compositing_active = true;
+ host->AcceleratedCompositingStateChange(surface_id, compositing_active);
+ }
+ last_frame_was_composited_ = true;
+ }
}
void RenderWidgetHostViewGtk::AcceleratedSurfacePostSubBuffer(
@@ -1158,6 +1172,7 @@ void RenderWidgetHostViewGtk::Paint(const gfx::Rect& damage_rect) {
// call the compositor directly.
RenderWidgetHostImpl* render_widget_host =
RenderWidgetHostImpl::From(GetRenderWidgetHost());
+
if (render_widget_host->is_accelerated_compositing_active()) {
host_->ScheduleComposite();
return;
@@ -1215,6 +1230,17 @@ void RenderWidgetHostViewGtk::Paint(const gfx::Rect& damage_rect) {
if (whiteout_start_time_.is_null())
whiteout_start_time_ = base::TimeTicks::Now();
}
+
+ if (last_frame_was_composited_ &&
+ compositing_surface_ != gfx::kNullPluginWindow) {
+ GpuProcessHostUIShim* host = GpuProcessHostUIShim::GetOneInstance();
+ int32 surface_id = compositing_surface_;
+ if (host) {
+ bool compositing_active = false;
+ host->AcceleratedCompositingStateChange(surface_id, compositing_active);
+ }
+ last_frame_was_composited_ = false;
+ }
}
void RenderWidgetHostViewGtk::ShowCurrentCursor() {
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_gtk.h ('k') | content/common/gpu/gpu_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698