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 #if defined(OS_ANDROID) | 7 #if defined(OS_ANDROID) |
8 #include <android/native_window_jni.h> | 8 #include <android/native_window_jni.h> |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 explicit EGLSyncControlVSyncProvider(EGLSurface surface) | 72 explicit EGLSyncControlVSyncProvider(EGLSurface surface) |
73 : SyncControlVSyncProvider(), | 73 : SyncControlVSyncProvider(), |
74 surface_(surface) { | 74 surface_(surface) { |
75 } | 75 } |
76 | 76 |
77 virtual ~EGLSyncControlVSyncProvider() { } | 77 virtual ~EGLSyncControlVSyncProvider() { } |
78 | 78 |
79 protected: | 79 protected: |
80 virtual bool GetSyncValues(int64* system_time, | 80 virtual bool GetSyncValues(int64* system_time, |
81 int64* media_stream_counter, | 81 int64* media_stream_counter, |
82 int64* swap_buffer_counter) OVERRIDE { | 82 int64* swap_buffer_counter) override { |
83 uint64 u_system_time, u_media_stream_counter, u_swap_buffer_counter; | 83 uint64 u_system_time, u_media_stream_counter, u_swap_buffer_counter; |
84 bool result = eglGetSyncValuesCHROMIUM( | 84 bool result = eglGetSyncValuesCHROMIUM( |
85 g_display, surface_, &u_system_time, | 85 g_display, surface_, &u_system_time, |
86 &u_media_stream_counter, &u_swap_buffer_counter) == EGL_TRUE; | 86 &u_media_stream_counter, &u_swap_buffer_counter) == EGL_TRUE; |
87 if (result) { | 87 if (result) { |
88 *system_time = static_cast<int64>(u_system_time); | 88 *system_time = static_cast<int64>(u_system_time); |
89 *media_stream_counter = static_cast<int64>(u_media_stream_counter); | 89 *media_stream_counter = static_cast<int64>(u_media_stream_counter); |
90 *swap_buffer_counter = static_cast<int64>(u_swap_buffer_counter); | 90 *swap_buffer_counter = static_cast<int64>(u_swap_buffer_counter); |
91 } | 91 } |
92 return result; | 92 return result; |
93 } | 93 } |
94 | 94 |
95 virtual bool GetMscRate(int32* numerator, int32* denominator) OVERRIDE { | 95 virtual bool GetMscRate(int32* numerator, int32* denominator) override { |
96 return false; | 96 return false; |
97 } | 97 } |
98 | 98 |
99 private: | 99 private: |
100 EGLSurface surface_; | 100 EGLSurface surface_; |
101 | 101 |
102 DISALLOW_COPY_AND_ASSIGN(EGLSyncControlVSyncProvider); | 102 DISALLOW_COPY_AND_ASSIGN(EGLSyncControlVSyncProvider); |
103 }; | 103 }; |
104 | 104 |
105 } // namespace | 105 } // namespace |
(...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
701 } | 701 } |
702 | 702 |
703 void* SurfacelessEGL::GetShareHandle() { | 703 void* SurfacelessEGL::GetShareHandle() { |
704 return NULL; | 704 return NULL; |
705 } | 705 } |
706 | 706 |
707 SurfacelessEGL::~SurfacelessEGL() { | 707 SurfacelessEGL::~SurfacelessEGL() { |
708 } | 708 } |
709 | 709 |
710 } // namespace gfx | 710 } // namespace gfx |
OLD | NEW |