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 "ui/gl/gl_surface_wgl.h" | 5 #include "ui/gl/gl_surface_wgl.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/trace_event/trace_event.h" | 10 #include "base/trace_event/trace_event.h" |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 size_.SetSize(1, 1); | 330 size_.SetSize(1, 1); |
331 } | 331 } |
332 | 332 |
333 PbufferGLSurfaceWGL::~PbufferGLSurfaceWGL() { | 333 PbufferGLSurfaceWGL::~PbufferGLSurfaceWGL() { |
334 Destroy(); | 334 Destroy(); |
335 } | 335 } |
336 | 336 |
337 bool PbufferGLSurfaceWGL::Initialize(GLSurface::Format format) { | 337 bool PbufferGLSurfaceWGL::Initialize(GLSurface::Format format) { |
338 DCHECK(!device_context_); | 338 DCHECK(!device_context_); |
339 | 339 |
340 if (!gl::g_driver_wgl.fn.wglCreatePbufferARBFn) { | 340 if (!g_driver_wgl.fn.wglCreatePbufferARBFn) { |
341 LOG(ERROR) << "wglCreatePbufferARB not available."; | 341 LOG(ERROR) << "wglCreatePbufferARB not available."; |
342 Destroy(); | 342 Destroy(); |
343 return false; | 343 return false; |
344 } | 344 } |
345 | 345 |
346 const int kNoAttributes[] = { 0 }; | 346 const int kNoAttributes[] = { 0 }; |
347 pbuffer_ = wglCreatePbufferARB(g_display->device_context(), | 347 pbuffer_ = wglCreatePbufferARB(g_display->device_context(), |
348 g_display->pixel_format(), | 348 g_display->pixel_format(), |
349 size_.width(), size_.height(), | 349 size_.width(), size_.height(), |
350 kNoAttributes); | 350 kNoAttributes); |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 | 388 |
389 gfx::Size PbufferGLSurfaceWGL::GetSize() { | 389 gfx::Size PbufferGLSurfaceWGL::GetSize() { |
390 return size_; | 390 return size_; |
391 } | 391 } |
392 | 392 |
393 void* PbufferGLSurfaceWGL::GetHandle() { | 393 void* PbufferGLSurfaceWGL::GetHandle() { |
394 return device_context_; | 394 return device_context_; |
395 } | 395 } |
396 | 396 |
397 } // namespace gl | 397 } // namespace gl |
OLD | NEW |