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_egl.h" | 5 #include "ui/gl/gl_surface_egl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 } | 429 } |
430 | 430 |
431 // If no displays are available due to missing angle extensions or invalid | 431 // If no displays are available due to missing angle extensions or invalid |
432 // flags, request the default display. | 432 // flags, request the default display. |
433 if (init_displays->empty()) { | 433 if (init_displays->empty()) { |
434 init_displays->push_back(DEFAULT); | 434 init_displays->push_back(DEFAULT); |
435 } | 435 } |
436 } | 436 } |
437 | 437 |
438 GLSurfaceEGL::GLSurfaceEGL() : | 438 GLSurfaceEGL::GLSurfaceEGL() : |
439 config_(nullptr), | 439 GLSurface(), |
440 format_(SURFACE_DEFAULT) {} | 440 config_(nullptr) {} |
441 | 441 |
442 bool GLSurfaceEGL::InitializeOneOff() { | 442 bool GLSurfaceEGL::InitializeOneOff() { |
443 static bool initialized = false; | 443 static bool initialized = false; |
444 if (initialized) | 444 if (initialized) |
445 return true; | 445 return true; |
446 | 446 |
447 InitializeDisplay(); | 447 InitializeDisplay(); |
448 if (g_display == EGL_NO_DISPLAY) | 448 if (g_display == EGL_NO_DISPLAY) |
449 return false; | 449 return false; |
450 | 450 |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
612 | 612 |
613 #if defined(OS_WIN) | 613 #if defined(OS_WIN) |
614 vsync_override_ = false; | 614 vsync_override_ = false; |
615 swap_generation_ = 0; | 615 swap_generation_ = 0; |
616 RECT windowRect; | 616 RECT windowRect; |
617 if (GetClientRect(window_, &windowRect)) | 617 if (GetClientRect(window_, &windowRect)) |
618 size_ = gfx::Rect(windowRect).size(); | 618 size_ = gfx::Rect(windowRect).size(); |
619 #endif | 619 #endif |
620 } | 620 } |
621 | 621 |
622 bool NativeViewGLSurfaceEGL::Initialize() { | |
623 return Initialize(SURFACE_DEFAULT); | |
624 } | |
625 | |
626 bool NativeViewGLSurfaceEGL::Initialize(GLSurface::Format format) { | 622 bool NativeViewGLSurfaceEGL::Initialize(GLSurface::Format format) { |
627 format_ = format; | 623 format_ = format; |
628 return Initialize(nullptr); | 624 return Initialize(nullptr); |
629 } | 625 } |
630 | 626 |
631 bool NativeViewGLSurfaceEGL::Initialize( | 627 bool NativeViewGLSurfaceEGL::Initialize( |
632 scoped_ptr<VSyncProvider> sync_provider) { | 628 scoped_ptr<VSyncProvider> sync_provider) { |
633 DCHECK(!surface_); | 629 DCHECK(!surface_); |
634 | 630 |
635 if (!GetDisplay()) { | 631 if (!GetDisplay()) { |
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1098 } | 1094 } |
1099 | 1095 |
1100 void* SurfacelessEGL::GetShareHandle() { | 1096 void* SurfacelessEGL::GetShareHandle() { |
1101 return NULL; | 1097 return NULL; |
1102 } | 1098 } |
1103 | 1099 |
1104 SurfacelessEGL::~SurfacelessEGL() { | 1100 SurfacelessEGL::~SurfacelessEGL() { |
1105 } | 1101 } |
1106 | 1102 |
1107 } // namespace gfx | 1103 } // namespace gfx |
OLD | NEW |