OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/browser/renderer_host/render_widget_host_view_win.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_win.h" |
6 | 6 |
7 #include <InputScope.h> | 7 #include <InputScope.h> |
8 #include <wtsapi32.h> | 8 #include <wtsapi32.h> |
9 #pragma comment(lib, "wtsapi32.lib") | 9 #pragma comment(lib, "wtsapi32.lib") |
10 | 10 |
(...skipping 2536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2547 0, 0, width, height, m_hWnd, 0, instance, 0); | 2547 0, 0, width, height, m_hWnd, 0, instance, 0); |
2548 gfx::CheckWindowCreated(compositor_host_window_); | 2548 gfx::CheckWindowCreated(compositor_host_window_); |
2549 | 2549 |
2550 gfx::SetWindowUserData(compositor_host_window_, this); | 2550 gfx::SetWindowUserData(compositor_host_window_, this); |
2551 | 2551 |
2552 gfx::GLSurfaceHandle surface_handle(compositor_host_window_, | 2552 gfx::GLSurfaceHandle surface_handle(compositor_host_window_, |
2553 gfx::NATIVE_TRANSPORT); | 2553 gfx::NATIVE_TRANSPORT); |
2554 return surface_handle; | 2554 return surface_handle; |
2555 } | 2555 } |
2556 | 2556 |
| 2557 void RenderWidgetHostViewWin::ResizeCompositingSurface(const gfx::Size& size) { |
| 2558 // Ensure window does not have zero area because D3D cannot create a zero |
| 2559 // area swap chain. |
| 2560 ::SetWindowPos(compositor_host_window_, |
| 2561 NULL, |
| 2562 0, 0, |
| 2563 std::max(1, size.width()), |
| 2564 std::max(1, size.height()), |
| 2565 SWP_NOSENDCHANGING | SWP_NOCOPYBITS | SWP_NOZORDER | |
| 2566 SWP_NOACTIVATE | SWP_DEFERERASE | SWP_NOMOVE); |
| 2567 } |
| 2568 |
2557 void RenderWidgetHostViewWin::OnAcceleratedCompositingStateChange() { | 2569 void RenderWidgetHostViewWin::OnAcceleratedCompositingStateChange() { |
2558 bool show = render_widget_host_->is_accelerated_compositing_active(); | 2570 bool show = render_widget_host_->is_accelerated_compositing_active(); |
2559 // When we first create the compositor, we will get a show request from | 2571 // When we first create the compositor, we will get a show request from |
2560 // the renderer before we have gotten the create request from the GPU. In this | 2572 // the renderer before we have gotten the create request from the GPU. In this |
2561 // case, simply ignore the show request. | 2573 // case, simply ignore the show request. |
2562 if (compositor_host_window_ == NULL) | 2574 if (compositor_host_window_ == NULL) |
2563 return; | 2575 return; |
2564 | 2576 |
2565 if (show) { | 2577 if (show) { |
2566 ::ShowWindow(compositor_host_window_, SW_SHOW); | 2578 ::ShowWindow(compositor_host_window_, SW_SHOW); |
(...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3181 return new RenderWidgetHostViewWin(widget); | 3193 return new RenderWidgetHostViewWin(widget); |
3182 } | 3194 } |
3183 | 3195 |
3184 // static | 3196 // static |
3185 void RenderWidgetHostViewPort::GetDefaultScreenInfo( | 3197 void RenderWidgetHostViewPort::GetDefaultScreenInfo( |
3186 WebKit::WebScreenInfo* results) { | 3198 WebKit::WebScreenInfo* results) { |
3187 GetScreenInfoForWindow(0, results); | 3199 GetScreenInfoForWindow(0, results); |
3188 } | 3200 } |
3189 | 3201 |
3190 } // namespace content | 3202 } // namespace content |
OLD | NEW |