Chromium Code Reviews| 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; |
| +} |