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

Side by Side Diff: ui/gl/gl_surface_wgl.cc

Issue 341673002: Blacklist (0,0) sized offscreen surfaces on Windows (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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) 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 "ui/gl/gl_surface_wgl.h" 5 #include "ui/gl/gl_surface_wgl.h"
6 6
7 #include "base/debug/trace_event.h" 7 #include "base/debug/trace_event.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "ui/gl/gl_bindings.h" 10 #include "ui/gl/gl_bindings.h"
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 } 278 }
279 279
280 void* NativeViewGLSurfaceWGL::GetHandle() { 280 void* NativeViewGLSurfaceWGL::GetHandle() {
281 return device_context_; 281 return device_context_;
282 } 282 }
283 283
284 PbufferGLSurfaceWGL::PbufferGLSurfaceWGL(const gfx::Size& size) 284 PbufferGLSurfaceWGL::PbufferGLSurfaceWGL(const gfx::Size& size)
285 : size_(size), 285 : size_(size),
286 device_context_(NULL), 286 device_context_(NULL),
287 pbuffer_(NULL) { 287 pbuffer_(NULL) {
288 // Some implementations of Pbuffer do not support having a 0 size. For such
289 // cases use a (1, 1) surface.
290 if (size_.GetArea() == 0)
291 size_.SetSize(1, 1);
288 } 292 }
289 293
290 PbufferGLSurfaceWGL::~PbufferGLSurfaceWGL() { 294 PbufferGLSurfaceWGL::~PbufferGLSurfaceWGL() {
291 Destroy(); 295 Destroy();
292 } 296 }
293 297
294 bool PbufferGLSurfaceWGL::Initialize() { 298 bool PbufferGLSurfaceWGL::Initialize() {
295 DCHECK(!device_context_); 299 DCHECK(!device_context_);
296 300
297 if (!gfx::g_driver_wgl.fn.wglCreatePbufferARBFn) { 301 if (!gfx::g_driver_wgl.fn.wglCreatePbufferARBFn) {
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 349
346 gfx::Size PbufferGLSurfaceWGL::GetSize() { 350 gfx::Size PbufferGLSurfaceWGL::GetSize() {
347 return size_; 351 return size_;
348 } 352 }
349 353
350 void* PbufferGLSurfaceWGL::GetHandle() { 354 void* PbufferGLSurfaceWGL::GetHandle() {
351 return device_context_; 355 return device_context_;
352 } 356 }
353 357
354 } // namespace gfx 358 } // 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