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

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

Issue 3549018: Fixed crash when GetClientRect fails.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 return false; 172 return false;
173 } 173 }
174 174
175 bool NativeViewEGLContext::SwapBuffers() { 175 bool NativeViewEGLContext::SwapBuffers() {
176 return eglSwapBuffers(g_display, surface_) == EGL_TRUE; 176 return eglSwapBuffers(g_display, surface_) == EGL_TRUE;
177 } 177 }
178 178
179 gfx::Size NativeViewEGLContext::GetSize() { 179 gfx::Size NativeViewEGLContext::GetSize() {
180 #if defined(OS_WIN) 180 #if defined(OS_WIN)
181 RECT rect; 181 RECT rect;
182 CHECK(GetClientRect(static_cast<HWND>(window_), &rect)); 182 if (!GetClientRect(static_cast<HWND>(window_), &rect)) {
183 DCHECK(false) << "GetClientRect failed.";
Ken Russell (switch to Gerrit) 2010/10/06 17:53:49 Given this fix, do you still want to assert in deb
184 return gfx::Size();
185 }
186
183 return gfx::Size(rect.right - rect.left, rect.bottom - rect.top); 187 return gfx::Size(rect.right - rect.left, rect.bottom - rect.top);
184 #else 188 #else
185 // TODO(piman): This doesn't work correctly on Windows yet, the size doesn't 189 // TODO(piman): This doesn't work correctly on Windows yet, the size doesn't
186 // get updated on resize. When it does, we can share the code. 190 // get updated on resize. When it does, we can share the code.
187 EGLint width; 191 EGLint width;
188 EGLint height; 192 EGLint height;
189 CHECK(eglQuerySurface(g_display, surface_, EGL_WIDTH, &width)); 193 CHECK(eglQuerySurface(g_display, surface_, EGL_WIDTH, &width));
190 CHECK(eglQuerySurface(g_display, surface_, EGL_HEIGHT, &height)); 194 CHECK(eglQuerySurface(g_display, surface_, EGL_HEIGHT, &height));
191 return gfx::Size(width, height); 195 return gfx::Size(width, height);
192 #endif 196 #endif
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 305
302 void* SecondaryEGLContext::GetHandle() { 306 void* SecondaryEGLContext::GetHandle() {
303 return context_; 307 return context_;
304 } 308 }
305 309
306 EGLSurface SecondaryEGLContext::GetSurface() { 310 EGLSurface SecondaryEGLContext::GetSurface() {
307 return surface_; 311 return surface_;
308 } 312 }
309 313
310 } // namespace gfx 314 } // namespace gfx
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698