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

Side by Side Diff: app/gfx/gl/gl_context_egl.cc

Issue 4815001: Use inner HWND for accelerated rendering on windows (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 1 month 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
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 <EGL/egl.h> 5 #include <EGL/egl.h>
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 #if defined(OS_LINUX) 8 #if defined(OS_LINUX)
9 #include "app/x11_util.h" 9 #include "app/x11_util.h"
10 #define EGL_HAS_PBUFFERS 1 10 #define EGL_HAS_PBUFFERS 1
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 bool NativeViewEGLContext::SwapBuffers() { 239 bool NativeViewEGLContext::SwapBuffers() {
240 if (!eglSwapBuffers(g_display, surface_)) { 240 if (!eglSwapBuffers(g_display, surface_)) {
241 VLOG(1) << "eglSwapBuffers failed with error " 241 VLOG(1) << "eglSwapBuffers failed with error "
242 << GetLastEGLErrorString(); 242 << GetLastEGLErrorString();
243 return false; 243 return false;
244 } 244 }
245 245
246 return true; 246 return true;
247 } 247 }
248 248
249 void NativeViewEGLContext::SetSize(gfx::Size size) {
250 #if defined(OS_WIN)
251 HWND hwnd = static_cast<HWND>(window_);
252 UINT swp_flags = SWP_NOSENDCHANGING | SWP_NOOWNERZORDER | SWP_NOCOPYBITS |
253 SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE | SWP_DEFERERASE;
254 SetWindowPos(hwnd, NULL, 0, 0, size.width(), size.height(), swp_flags);
255 #endif
256 }
257
249 gfx::Size NativeViewEGLContext::GetSize() { 258 gfx::Size NativeViewEGLContext::GetSize() {
250 #if defined(OS_WIN) 259 #if defined(OS_WIN)
251 RECT rect; 260 RECT rect;
252 if (!GetClientRect(static_cast<HWND>(window_), &rect)) { 261 if (!GetClientRect(static_cast<HWND>(window_), &rect)) {
253 DCHECK(false) << "GetClientRect failed."; 262 DCHECK(false) << "GetClientRect failed.";
254 return gfx::Size(); 263 return gfx::Size();
255 } 264 }
256 265
257 return gfx::Size(rect.right - rect.left, rect.bottom - rect.top); 266 return gfx::Size(rect.right - rect.left, rect.bottom - rect.top);
258 #else 267 #else
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
407 void SecondaryEGLContext::SetSwapInterval(int interval) { 416 void SecondaryEGLContext::SetSwapInterval(int interval) {
408 DCHECK(IsCurrent()); 417 DCHECK(IsCurrent());
409 NOTREACHED() << "Attempt to call SetSwapInterval on a SecondaryEGLContext."; 418 NOTREACHED() << "Attempt to call SetSwapInterval on a SecondaryEGLContext.";
410 } 419 }
411 420
412 EGLSurface SecondaryEGLContext::GetSurface() { 421 EGLSurface SecondaryEGLContext::GetSurface() {
413 return surface_; 422 return surface_;
414 } 423 }
415 424
416 } // namespace gfx 425 } // namespace gfx
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698