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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_win.cc

Issue 25795002: Move surface resize platform code from GpuProcessHostUIShim to RenderWidgetHostView implementations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 2 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
OLDNEW
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
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 gfx::GLSurfaceHandle surface = GetCompositingSurface();
2559
2560 // Ensure window does not have zero area because D3D cannot create a zero
2561 // area swap chain.
2562 SetWindowPos(surface.handle,
piman 2013/10/03 00:17:29 surface.handle is compositor_host_window_
2563 NULL,
2564 0, 0,
2565 std::max(1, size.width()),
2566 std::max(1, size.height()),
2567 SWP_NOSENDCHANGING | SWP_NOCOPYBITS | SWP_NOZORDER |
2568 SWP_NOACTIVATE | SWP_DEFERERASE | SWP_NOMOVE);
2569 }
2570
2557 void RenderWidgetHostViewWin::OnAcceleratedCompositingStateChange() { 2571 void RenderWidgetHostViewWin::OnAcceleratedCompositingStateChange() {
2558 bool show = render_widget_host_->is_accelerated_compositing_active(); 2572 bool show = render_widget_host_->is_accelerated_compositing_active();
2559 // When we first create the compositor, we will get a show request from 2573 // 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 2574 // the renderer before we have gotten the create request from the GPU. In this
2561 // case, simply ignore the show request. 2575 // case, simply ignore the show request.
2562 if (compositor_host_window_ == NULL) 2576 if (compositor_host_window_ == NULL)
2563 return; 2577 return;
2564 2578
2565 if (show) { 2579 if (show) {
2566 ::ShowWindow(compositor_host_window_, SW_SHOW); 2580 ::ShowWindow(compositor_host_window_, SW_SHOW);
(...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after
3181 return new RenderWidgetHostViewWin(widget); 3195 return new RenderWidgetHostViewWin(widget);
3182 } 3196 }
3183 3197
3184 // static 3198 // static
3185 void RenderWidgetHostViewPort::GetDefaultScreenInfo( 3199 void RenderWidgetHostViewPort::GetDefaultScreenInfo(
3186 WebKit::WebScreenInfo* results) { 3200 WebKit::WebScreenInfo* results) {
3187 GetScreenInfoForWindow(0, results); 3201 GetScreenInfoForWindow(0, results);
3188 } 3202 }
3189 3203
3190 } // namespace content 3204 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698