OLD | NEW |
---|---|
(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 } | |
OLD | NEW |