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

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

Issue 9582003: Support browser side thumbnailing for GPU composited pages on Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: '' Created 8 years, 10 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.cc ('k') | content/content_browser.gypi » ('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_win.cc
diff --git a/content/browser/renderer_host/render_widget_host_win.cc b/content/browser/renderer_host/render_widget_host_win.cc
new file mode 100644
index 0000000000000000000000000000000000000000..71c101ee77115bf9b7bf835ad2c9e691e7d4937b
--- /dev/null
+++ b/content/browser/renderer_host/render_widget_host_win.cc
@@ -0,0 +1,30 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "content/browser/renderer_host/render_widget_host.h"
+
+#include "base/win/scoped_hdc.h"
+#include "content/public/browser/render_widget_host_view.h"
+#include "skia/ext/platform_canvas.h"
+#include "ui/gfx/rect.h"
+
+bool RenderWidgetHostImpl::CopyFromCompositingSurface(
+ skia::PlatformCanvas* output) {
+ if (!is_accelerated_compositing_active_)
+ return false;
+
+ if (!view())
+ return false;
+
+ const gfx::Rect bounds = view()->GetViewBounds();
+ if (!output->initialize(bounds.width(), bounds.height(), true))
+ return false;
+
+ skia::ScopedPlatformPaint scoped_platform_paint(output);
+ gfx::NativeWindow window_handle = GetCompositingSurface().handle;
+ base::win::ScopedGetDC window_hdc(window_handle);
+ HDC temp_dc = scoped_platform_paint.GetPlatformSurface();
+ return BitBlt(temp_dc, 0, 0, bounds.width(), bounds.height(), window_hdc,
vangelis 2012/03/05 06:20:55 I think ideally we'll want to get the bits out of
mazda 2012/03/05 15:54:14 Did you mean GetCompositingSurface()? I plan to mo
+ 0, 0, SRCCOPY) != 0;
+}
« no previous file with comments | « content/browser/renderer_host/render_widget_host.cc ('k') | content/content_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698