summarylogtreecommitdiffstats
path: root/eglGetMscRateCHROMIUM.patch
blob: 07557635196c60dcf92994b4d4cff3eb3d7f37c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
From 5cddfb828ddd82fc741549d5ee44cd9b94bd97f5 Mon Sep 17 00:00:00 2001
From: Jonah Ryan-Davis <jonahr@google.com>
Date: Mon, 30 Mar 2020 17:13:54 +0000
Subject: [PATCH] Use EGL_ANGLE_sync_control_rate for eglGetMscRate call

eglGetMscRateCHROMIUM is not universally supported, so we will
switch to using the ANGLE version of the extension instead.

Bug: chromium:1064078
Change-Id: Ic57e2e55230df1d1c2c584e1cbf54331330a0b87
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2120453
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
Cr-Commit-Position: refs/heads/master@{#754518}
---

diff --git a/gpu/GLES2/extensions/ANGLE/EGL_ANGLE_sync_control_rate.txt b/gpu/GLES2/extensions/ANGLE/EGL_ANGLE_sync_control_rate.txt
new file mode 100644
index 0000000..2056ae8
--- /dev/null
+++ b/gpu/GLES2/extensions/ANGLE/EGL_ANGLE_sync_control_rate.txt
@@ -0,0 +1,110 @@
+Name
+
+   ANGLE_sync_control_rate
+
+Name Strings
+
+   EGL_ANGLE_sync_control_rate
+
+Contact
+
+   Jonah Ryan-Davis, Google (jonahr 'at' google.com)
+
+Status
+
+   Draft.
+
+Version
+
+   Version 1, 2020-03-24
+
+   Based on GLX_OML_sync_control Revision 6.0
+
+Number
+
+   ???
+
+Dependencies
+
+   The extension is written against the EGL 1.2 Specification, although it
+   should work on other versions of these specifications. This extension
+   also requires an operating system which supports CLOCK_MONOTONIC.
+
+Overview
+
+   This extension provides counters which let applications know about the
+   timing of the last vertical retrace. By looking at the system clock, as
+   well as the refresh rate of the monitor, this should enable applications
+   to predict the position of future retraces so as to schedule an optimal
+   workload.
+
+   This extension incorporates the use of three counters that provide
+   the necessary synchronization. The Unadjusted System Time (or UST)
+   is the 64-bit CLOCK_MONOTONIC clock; in particular this lets the
+   application schedule future vertical retraces by querying this clock.
+   The graphics Media Stream Counter (or graphics MSC) is a counter
+   that is unique to the graphics subsystem and increments for each
+   vertical retrace that occurs. The Swap Buffer Counter (SBC) is an
+   attribute of an EGLSurface and is incremented each time a swap
+   buffer action is performed on the associated surface.
+
+   The use of these three counters allows the application to
+   synchronize graphics rendering to vertical retraces and/or swap
+   buffer actions. For example, by querying the synchronization values for
+   a given surface, the application can accurately predict the timing for
+   the next vertical retraces and schedule rendering accordingly.
+
+Issues
+
+   None.
+
+IP Status
+
+   No known issues.
+
+New Procedures and Functions
+
+   Bool eglGetMscRateANGLE(EGLDisplay* dpy,
+                           EGLSurface surface,
+                           int32_t* numerator,
+                           int32_t* denominator)
+
+New Tokens
+
+   None
+
+Additions to the EGL 1.3 Specification
+
+   The graphics MSC value is incremented once for each screen refresh.
+   For a non-interlaced display, this means that the graphics MSC value
+   is incremented for each frame. For an interlaced display, it means
+   that it will be incremented for each field. For a multi-monitor
+   system, the monitor used to determine MSC is the one where the surface
+   is located. If the surface spans multiple monitors, the monitor used
+   to determine MSC is the one with the biggest coverage in pixels.
+
+   eglGetMscRateANGLE returns the rate at which the MSC will be incremented
+   for the display associated with <hdc>. The rate is expressed in Hertz
+   as <numerator> / <denominator>. If the MSC rate in Hertz is an
+   integer, then <denominator> will be 1 and <numerator> will be
+   the MSC rate.
+
+   The function eglGetMscRateANGLE will return TRUE if the function
+   completed successfully, FALSE otherwise.
+
+   Each time eglSwapBuffer succeeds, the SBC will be increased within a
+   finite time period.
+
+Errors
+
+   The function eglGetMscRateANGLE will return FALSE if there is no
+   current EGLContext.
+
+New Implementation Dependent State
+
+   None
+
+Revision History
+
+    Version 1, 2020-03-24 (Jonah Ryan-Davis)
+       - Initial draft, based on GLX_OML_sync_control revision 6.0.
diff --git a/gpu/GLES2/extensions/CHROMIUM/EGL_CHROMIUM_sync_control.txt b/gpu/GLES2/extensions/CHROMIUM/EGL_CHROMIUM_sync_control.txt
index 14f4e56..f699f61 100644
--- a/gpu/GLES2/extensions/CHROMIUM/EGL_CHROMIUM_sync_control.txt
+++ b/gpu/GLES2/extensions/CHROMIUM/EGL_CHROMIUM_sync_control.txt
@@ -16,7 +16,7 @@
 
 Version
 
-   Version 3, 2020-01-23
+   Version 2, 2015-05-05
 
    Based on GLX_OML_sync_control Revision 6.0
 
@@ -70,12 +70,6 @@
                                  int64_t* msc,
                                  int64_t* sbc)
 
-   Bool eglGetMscRateCHROMIUM(EGLDisplay* dpy,
-                              EGLSurface surface,
-                              int32_t* numerator,
-                              int32_t* denominator)
-
-
 New Tokens
 
    None
@@ -112,22 +106,16 @@
    is located. If the surface spans multiple monitors, the monitor used
    to determine MSC is the one with the biggest coverage in pixels.
 
-   eglGetMscRateCHROMIUM returns the rate at which the MSC will be incremented
-   for the display associated with <hdc>. The rate is expressed in Hertz
-   as <numerator> / <denominator>. If the MSC rate in Hertz is an
-   integer, then <denominator> will be 1 and <numerator> will be
-   the MSC rate.
-
-   The functions eglGetSyncValuesCHROMIUM, and eglGetMscRateCHROMIUM will
-   return TRUE if the function completed successfully, FALSE otherwise.
+   The function eglGetSyncValuesCHROMIUM will return TRUE if the function
+   completed successfully, FALSE otherwise.
 
    Each time eglSwapBuffer succeeds, the SBC will be increased within a
    finite time period.
 
 Errors
 
-   The functions eglGetSyncValuesCHROMIUM, and eglGetMscRateCHROMIUM will
-   return FALSE if there is no current EGLContext.
+   The function eglGetSyncValuesCHROMIUM will return FALSE if there is no
+   current EGLContext.
 
 
 New State
@@ -144,10 +132,6 @@
 
 Revision History
 
-    Version 3, 2020-01-23 (Jonah Ryan-Davis)
-       - Add the function eglGetMscRateCHROMIUM based on glXGetMscRateOML from
-         GLX_OML_sync_control revision 6.0.
-
     Version 2, 2015-05-05 (Chad Versace)
        - Rename to EGL_CHROMIUM_sync_control from EGL_CHROMIUM_get_sync_values.
          EGL_CHROMIUM_sync_control is the de facto extension name because all
diff --git a/ui/gl/EGL/eglextchromium.h b/ui/gl/EGL/eglextchromium.h
index e66d34a..22e3cf0 100644
--- a/ui/gl/EGL/eglextchromium.h
+++ b/ui/gl/EGL/eglextchromium.h
@@ -22,21 +22,26 @@
 EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncValuesCHROMIUM(
     EGLDisplay dpy, EGLSurface surface, EGLuint64CHROMIUM *ust,
     EGLuint64CHROMIUM *msc, EGLuint64CHROMIUM *sbc);
-EGLAPI EGLBoolean EGLAPIENTRY eglGetMscRateCHROMIUM(EGLDisplay dpy,
-                                                    EGLSurface surface,
-                                                    EGLint* numerator,
-                                                    EGLint* denominator);
 #endif /* EGL_EGLEXT_PROTOTYPES */
 typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCVALUESCHROMIUMPROC)
     (EGLDisplay dpy, EGLSurface surface, EGLuint64CHROMIUM *ust,
      EGLuint64CHROMIUM *msc, EGLuint64CHROMIUM *sbc);
-typedef EGLBoolean(EGLAPIENTRYP PFNEGLGETMSCRATECHROMIUMPROC)(
-    EGLDisplay dpy,
-    EGLSurface surface,
-    EGLint* numerator,
-    EGLint* denominator);
-#endif
-#endif
+#endif /* EGL_CHROMIUM_sync_control */
+
+#ifndef EGL_ANGLE_sync_control_rate
+#define EGL_ANGLE_sync_control_rate 1
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLBoolean EGLAPIENTRY eglGetMscRateANGLE(EGLDisplay dpy,
+                                                 EGLSurface surface,
+                                                 EGLint* numerator,
+                                                 EGLint* denominator);
+#endif /* EGL_EGLEXT_PROTOTYPES */
+typedef EGLBoolean(EGLAPIENTRYP PFNEGLGETMSCRATEANGLEPROC)(EGLDisplay dpy,
+                                                           EGLSurface surface,
+                                                           EGLint* numerator,
+                                                           EGLint* denominator);
+#endif /* EGL_ANGLE_sync_control_rate */
+#endif /* KHRONOS_SUPPORT_INT64 */
 
 #ifdef __cplusplus
 }
diff --git a/ui/gl/egl_bindings_autogen_mock.cc b/ui/gl/egl_bindings_autogen_mock.cc
index f6562ad..d4d3a04 100644
--- a/ui/gl/egl_bindings_autogen_mock.cc
+++ b/ui/gl/egl_bindings_autogen_mock.cc
@@ -299,12 +299,12 @@
 }
 
 EGLBoolean GL_BINDING_CALL
-MockEGLInterface::Mock_eglGetMscRateCHROMIUM(EGLDisplay dpy,
-                                             EGLSurface surface,
-                                             EGLint* numerator,
-                                             EGLint* denominator) {
-  MakeEglMockFunctionUnique("eglGetMscRateCHROMIUM");
-  return interface_->GetMscRateCHROMIUM(dpy, surface, numerator, denominator);
+MockEGLInterface::Mock_eglGetMscRateANGLE(EGLDisplay dpy,
+                                          EGLSurface surface,
+                                          EGLint* numerator,
+                                          EGLint* denominator) {
+  MakeEglMockFunctionUnique("eglGetMscRateANGLE");
+  return interface_->GetMscRateANGLE(dpy, surface, numerator, denominator);
 }
 
 EGLClientBuffer GL_BINDING_CALL
@@ -706,8 +706,8 @@
   if (strcmp(name, "eglGetFrameTimestampsANDROID") == 0)
     return reinterpret_cast<GLFunctionPointerType>(
         Mock_eglGetFrameTimestampsANDROID);
-  if (strcmp(name, "eglGetMscRateCHROMIUM") == 0)
-    return reinterpret_cast<GLFunctionPointerType>(Mock_eglGetMscRateCHROMIUM);
+  if (strcmp(name, "eglGetMscRateANGLE") == 0)
+    return reinterpret_cast<GLFunctionPointerType>(Mock_eglGetMscRateANGLE);
   if (strcmp(name, "eglGetNativeClientBufferANDROID") == 0)
     return reinterpret_cast<GLFunctionPointerType>(
         Mock_eglGetNativeClientBufferANDROID);
diff --git a/ui/gl/egl_bindings_autogen_mock.h b/ui/gl/egl_bindings_autogen_mock.h
index 06f1117..4b7eb01 100644
--- a/ui/gl/egl_bindings_autogen_mock.h
+++ b/ui/gl/egl_bindings_autogen_mock.h
@@ -131,11 +131,10 @@
                                   EGLint numTimestamps,
                                   EGLint* timestamps,
                                   EGLnsecsANDROID* values);
-static EGLBoolean GL_BINDING_CALL
-Mock_eglGetMscRateCHROMIUM(EGLDisplay dpy,
-                           EGLSurface surface,
-                           EGLint* numerator,
-                           EGLint* denominator);
+static EGLBoolean GL_BINDING_CALL Mock_eglGetMscRateANGLE(EGLDisplay dpy,
+                                                          EGLSurface surface,
+                                                          EGLint* numerator,
+                                                          EGLint* denominator);
 static EGLClientBuffer GL_BINDING_CALL Mock_eglGetNativeClientBufferANDROID(
     const struct AHardwareBuffer* ahardwarebuffer);
 static EGLBoolean GL_BINDING_CALL
diff --git a/ui/gl/generate_bindings.py b/ui/gl/generate_bindings.py
index 6a89047..01da79a 100755
--- a/ui/gl/generate_bindings.py
+++ b/ui/gl/generate_bindings.py
@@ -2452,9 +2452,9 @@
                  ] }],
   'arguments': 'EGLDisplay dpy, EGLSurface surface, EGLint timestamp', },
 { 'return_type': 'EGLBoolean',
-  'versions': [{ 'name': 'eglGetMscRateCHROMIUM',
+  'versions': [{ 'name': 'eglGetMscRateANGLE',
                  'extensions': [
-                   'EGL_CHROMIUM_sync_control'
+                   'EGL_ANGLE_sync_control_rate'
                  ] }],
   'arguments':
       'EGLDisplay dpy, EGLSurface surface, '
diff --git a/ui/gl/gl_bindings_api_autogen_egl.h b/ui/gl/gl_bindings_api_autogen_egl.h
index 8628d7c..30b0ba80 100644
--- a/ui/gl/gl_bindings_api_autogen_egl.h
+++ b/ui/gl/gl_bindings_api_autogen_egl.h
@@ -111,10 +111,10 @@
 EGLBoolean eglGetFrameTimestampSupportedANDROIDFn(EGLDisplay dpy,
                                                   EGLSurface surface,
                                                   EGLint timestamp) override;
-EGLBoolean eglGetMscRateCHROMIUMFn(EGLDisplay dpy,
-                                   EGLSurface surface,
-                                   EGLint* numerator,
-                                   EGLint* denominator) override;
+EGLBoolean eglGetMscRateANGLEFn(EGLDisplay dpy,
+                                EGLSurface surface,
+                                EGLint* numerator,
+                                EGLint* denominator) override;
 EGLClientBuffer eglGetNativeClientBufferANDROIDFn(
     const struct AHardwareBuffer* ahardwarebuffer) override;
 EGLBoolean eglGetNextFrameIdANDROIDFn(EGLDisplay dpy,
diff --git a/ui/gl/gl_bindings_autogen_egl.cc b/ui/gl/gl_bindings_autogen_egl.cc
index 2f1ed11..18444223 100644
--- a/ui/gl/gl_bindings_autogen_egl.cc
+++ b/ui/gl/gl_bindings_autogen_egl.cc
@@ -187,6 +187,8 @@
       gfx::HasExtension(extensions, "EGL_ANGLE_stream_producer_d3d_texture");
   ext.b_EGL_ANGLE_surface_d3d_texture_2d_share_handle = gfx::HasExtension(
       extensions, "EGL_ANGLE_surface_d3d_texture_2d_share_handle");
+  ext.b_EGL_ANGLE_sync_control_rate =
+      gfx::HasExtension(extensions, "EGL_ANGLE_sync_control_rate");
   ext.b_EGL_CHROMIUM_sync_control =
       gfx::HasExtension(extensions, "EGL_CHROMIUM_sync_control");
   ext.b_EGL_EXT_image_flush_external =
@@ -278,9 +280,9 @@
             GetGLProcAddress("eglGetFrameTimestampSupportedANDROID"));
   }
 
-  if (ext.b_EGL_CHROMIUM_sync_control) {
-    fn.eglGetMscRateCHROMIUMFn = reinterpret_cast<eglGetMscRateCHROMIUMProc>(
-        GetGLProcAddress("eglGetMscRateCHROMIUM"));
+  if (ext.b_EGL_ANGLE_sync_control_rate) {
+    fn.eglGetMscRateANGLEFn = reinterpret_cast<eglGetMscRateANGLEProc>(
+        GetGLProcAddress("eglGetMscRateANGLE"));
   }
 
   if (ext.b_EGL_ANDROID_get_native_client_buffer) {
@@ -602,12 +604,11 @@
                                                             timestamp);
 }
 
-EGLBoolean EGLApiBase::eglGetMscRateCHROMIUMFn(EGLDisplay dpy,
-                                               EGLSurface surface,
-                                               EGLint* numerator,
-                                               EGLint* denominator) {
-  return driver_->fn.eglGetMscRateCHROMIUMFn(dpy, surface, numerator,
-                                             denominator);
+EGLBoolean EGLApiBase::eglGetMscRateANGLEFn(EGLDisplay dpy,
+                                            EGLSurface surface,
+                                            EGLint* numerator,
+                                            EGLint* denominator) {
+  return driver_->fn.eglGetMscRateANGLEFn(dpy, surface, numerator, denominator);
 }
 
 EGLClientBuffer EGLApiBase::eglGetNativeClientBufferANDROIDFn(
@@ -1117,13 +1118,12 @@
                                                           timestamp);
 }
 
-EGLBoolean TraceEGLApi::eglGetMscRateCHROMIUMFn(EGLDisplay dpy,
-                                                EGLSurface surface,
-                                                EGLint* numerator,
-                                                EGLint* denominator) {
-  TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceEGLAPI::eglGetMscRateCHROMIUM")
-  return egl_api_->eglGetMscRateCHROMIUMFn(dpy, surface, numerator,
-                                           denominator);
+EGLBoolean TraceEGLApi::eglGetMscRateANGLEFn(EGLDisplay dpy,
+                                             EGLSurface surface,
+                                             EGLint* numerator,
+                                             EGLint* denominator) {
+  TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceEGLAPI::eglGetMscRateANGLE")
+  return egl_api_->eglGetMscRateANGLEFn(dpy, surface, numerator, denominator);
 }
 
 EGLClientBuffer TraceEGLApi::eglGetNativeClientBufferANDROIDFn(
@@ -1811,16 +1811,16 @@
   return result;
 }
 
-EGLBoolean LogEGLApi::eglGetMscRateCHROMIUMFn(EGLDisplay dpy,
-                                              EGLSurface surface,
-                                              EGLint* numerator,
-                                              EGLint* denominator) {
-  GL_SERVICE_LOG("eglGetMscRateCHROMIUM"
+EGLBoolean LogEGLApi::eglGetMscRateANGLEFn(EGLDisplay dpy,
+                                           EGLSurface surface,
+                                           EGLint* numerator,
+                                           EGLint* denominator) {
+  GL_SERVICE_LOG("eglGetMscRateANGLE"
                  << "(" << dpy << ", " << surface << ", "
                  << static_cast<const void*>(numerator) << ", "
                  << static_cast<const void*>(denominator) << ")");
   EGLBoolean result =
-      egl_api_->eglGetMscRateCHROMIUMFn(dpy, surface, numerator, denominator);
+      egl_api_->eglGetMscRateANGLEFn(dpy, surface, numerator, denominator);
   GL_SERVICE_LOG("GL_RESULT: " << result);
   return result;
 }
diff --git a/ui/gl/gl_bindings_autogen_egl.h b/ui/gl/gl_bindings_autogen_egl.h
index 546e2c9..6cafd14 100644
--- a/ui/gl/gl_bindings_autogen_egl.h
+++ b/ui/gl/gl_bindings_autogen_egl.h
@@ -141,7 +141,7 @@
     EGLDisplay dpy,
     EGLSurface surface,
     EGLint timestamp);
-typedef EGLBoolean(GL_BINDING_CALL* eglGetMscRateCHROMIUMProc)(
+typedef EGLBoolean(GL_BINDING_CALL* eglGetMscRateANGLEProc)(
     EGLDisplay dpy,
     EGLSurface surface,
     EGLint* numerator,
@@ -296,6 +296,7 @@
   bool b_EGL_ANGLE_query_surface_pointer;
   bool b_EGL_ANGLE_stream_producer_d3d_texture;
   bool b_EGL_ANGLE_surface_d3d_texture_2d_share_handle;
+  bool b_EGL_ANGLE_sync_control_rate;
   bool b_EGL_CHROMIUM_sync_control;
   bool b_EGL_EXT_image_flush_external;
   bool b_EGL_KHR_fence_sync;
@@ -351,7 +352,7 @@
   eglGetFrameTimestampsANDROIDProc eglGetFrameTimestampsANDROIDFn;
   eglGetFrameTimestampSupportedANDROIDProc
       eglGetFrameTimestampSupportedANDROIDFn;
-  eglGetMscRateCHROMIUMProc eglGetMscRateCHROMIUMFn;
+  eglGetMscRateANGLEProc eglGetMscRateANGLEFn;
   eglGetNativeClientBufferANDROIDProc eglGetNativeClientBufferANDROIDFn;
   eglGetNextFrameIdANDROIDProc eglGetNextFrameIdANDROIDFn;
   eglGetPlatformDisplayProc eglGetPlatformDisplayFn;
@@ -512,10 +513,10 @@
       EGLDisplay dpy,
       EGLSurface surface,
       EGLint timestamp) = 0;
-  virtual EGLBoolean eglGetMscRateCHROMIUMFn(EGLDisplay dpy,
-                                             EGLSurface surface,
-                                             EGLint* numerator,
-                                             EGLint* denominator) = 0;
+  virtual EGLBoolean eglGetMscRateANGLEFn(EGLDisplay dpy,
+                                          EGLSurface surface,
+                                          EGLint* numerator,
+                                          EGLint* denominator) = 0;
   virtual EGLClientBuffer eglGetNativeClientBufferANDROIDFn(
       const struct AHardwareBuffer* ahardwarebuffer) = 0;
   virtual EGLBoolean eglGetNextFrameIdANDROIDFn(EGLDisplay dpy,
@@ -685,8 +686,7 @@
   ::gl::g_current_egl_context->eglGetFrameTimestampsANDROIDFn
 #define eglGetFrameTimestampSupportedANDROID \
   ::gl::g_current_egl_context->eglGetFrameTimestampSupportedANDROIDFn
-#define eglGetMscRateCHROMIUM \
-  ::gl::g_current_egl_context->eglGetMscRateCHROMIUMFn
+#define eglGetMscRateANGLE ::gl::g_current_egl_context->eglGetMscRateANGLEFn
 #define eglGetNativeClientBufferANDROID \
   ::gl::g_current_egl_context->eglGetNativeClientBufferANDROIDFn
 #define eglGetNextFrameIdANDROID \
diff --git a/ui/gl/gl_enums_implementation_autogen.h b/ui/gl/gl_enums_implementation_autogen.h
index d35439c..1209923b 100644
--- a/ui/gl/gl_enums_implementation_autogen.h
+++ b/ui/gl/gl_enums_implementation_autogen.h
@@ -829,10 +829,6 @@
         "GL_FILL_NV",
     },
     {
-        0x1D00,
-        "GL_FLAT_CHROMIUM",
-    },
-    {
         0x1E00,
         "GL_KEEP",
     },
@@ -877,14 +873,6 @@
         "GL_FONT_NUM_GLYPH_INDICES_BIT_NV",
     },
     {
-        0x2400,
-        "GL_EYE_LINEAR_CHROMIUM",
-    },
-    {
-        0x2401,
-        "GL_OBJECT_LINEAR_CHROMIUM",
-    },
-    {
         0x2600,
         "GL_NEAREST",
     },
@@ -2053,10 +2041,6 @@
         "GL_MAX_CUBE_MAP_TEXTURE_SIZE",
     },
     {
-        0x8576,
-        "GL_CONSTANT_CHROMIUM",
-    },
-    {
         0x8589,
         "GL_SRC1_ALPHA_EXT",
     },
@@ -4629,10 +4613,6 @@
         "GL_PATH_CLIENT_LENGTH_NV",
     },
     {
-        0x907a,
-        "GL_PATH_MITER_LIMIT_CHROMIUM",
-    },
-    {
         0x9080,
         "GL_PATH_FILL_MODE_NV",
     },
@@ -4653,10 +4633,6 @@
         "GL_PATH_STROKE_MASK_NV",
     },
     {
-        0x9086,
-        "GL_PATH_STROKE_BOUND_CHROMIUM",
-    },
-    {
         0x9088,
         "GL_COUNT_UP_NV",
     },
@@ -4965,14 +4941,6 @@
         "GL_CONTEXT_ROBUST_ACCESS_KHR",
     },
     {
-        0x90a3,
-        "GL_SQUARE_CHROMIUM",
-    },
-    {
-        0x90a4,
-        "GL_ROUND_CHROMIUM",
-    },
-    {
         0x9100,
         "GL_TEXTURE_2D_MULTISAMPLE",
     },
diff --git a/ui/gl/gl_mock_autogen_egl.h b/ui/gl/gl_mock_autogen_egl.h
index bcdd2a3..ba2f95f 100644
--- a/ui/gl/gl_mock_autogen_egl.h
+++ b/ui/gl/gl_mock_autogen_egl.h
@@ -121,7 +121,7 @@
                         EGLnsecsANDROID* values));
 MOCK_METHOD3(GetFrameTimestampSupportedANDROID,
              EGLBoolean(EGLDisplay dpy, EGLSurface surface, EGLint timestamp));
-MOCK_METHOD4(GetMscRateCHROMIUM,
+MOCK_METHOD4(GetMscRateANGLE,
              EGLBoolean(EGLDisplay dpy,
                         EGLSurface surface,
                         EGLint* numerator,
diff --git a/ui/gl/gl_surface_egl.cc b/ui/gl/gl_surface_egl.cc
index 72268904..750f3ed 100644
--- a/ui/gl/gl_surface_egl.cc
+++ b/ui/gl/gl_surface_egl.cc
@@ -174,6 +174,7 @@
 bool g_egl_create_context_bind_generates_resource_supported = false;
 bool g_egl_create_context_webgl_compatability_supported = false;
 bool g_egl_sync_control_supported = false;
+bool g_egl_sync_control_rate_supported = false;
 bool g_egl_window_fixed_size_supported = false;
 bool g_egl_surfaceless_context_supported = false;
 bool g_egl_surface_orientation_supported = false;
@@ -266,8 +267,12 @@
   }
 
   bool GetMscRate(int32_t* numerator, int32_t* denominator) override {
+    if (!g_egl_sync_control_rate_supported) {
+      return false;
+    }
+ 
-    bool result = eglGetMscRateCHROMIUM(g_egl_display, surface_, numerator,
-                                        denominator) == EGL_TRUE;
+    bool result = eglGetMscRateANGLE(g_egl_display, surface_, numerator,
+                                     denominator) == EGL_TRUE;
     return result;
   }
 
@@ -921,6 +920,8 @@
   g_egl_create_context_webgl_compatability_supported =
       HasEGLExtension("EGL_ANGLE_create_context_webgl_compatibility");
   g_egl_sync_control_supported = HasEGLExtension("EGL_CHROMIUM_sync_control");
+  g_egl_sync_control_rate_supported =
+      HasEGLExtension("EGL_ANGLE_sync_control_rate");
   g_egl_window_fixed_size_supported =
       HasEGLExtension("EGL_ANGLE_window_fixed_size");
   g_egl_surface_orientation_supported =
@@ -1036,6 +1037,7 @@
   g_egl_create_context_bind_generates_resource_supported = false;
   g_egl_create_context_webgl_compatability_supported = false;
   g_egl_sync_control_supported = false;
+  g_egl_sync_control_rate_supported = false;
   g_egl_window_fixed_size_supported = false;
   g_egl_surface_orientation_supported = false;
   g_egl_surfaceless_context_supported = false;