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

Side by Side 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, 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 | Annotate | Revision Log
« no previous file with comments | « content/browser/renderer_host/render_widget_host.cc ('k') | content/content_browser.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "content/browser/renderer_host/render_widget_host.h"
6
7 #include "base/win/scoped_hdc.h"
8 #include "content/public/browser/render_widget_host_view.h"
9 #include "skia/ext/platform_canvas.h"
10 #include "ui/gfx/rect.h"
11
12 bool RenderWidgetHostImpl::CopyFromCompositingSurface(
13 skia::PlatformCanvas* output) {
14 if (!is_accelerated_compositing_active_)
15 return false;
16
17 if (!view())
18 return false;
19
20 const gfx::Rect bounds = view()->GetViewBounds();
21 if (!output->initialize(bounds.width(), bounds.height(), true))
22 return false;
23
24 skia::ScopedPlatformPaint scoped_platform_paint(output);
25 gfx::NativeWindow window_handle = GetCompositingSurface().handle;
26 base::win::ScopedGetDC window_hdc(window_handle);
27 HDC temp_dc = scoped_platform_paint.GetPlatformSurface();
28 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
29 0, 0, SRCCOPY) != 0;
30 }
OLDNEW
« 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