external_textures_1006.patch 55.8 KB
Newer Older
1
diff --git content/browser/compositor/browser_compositor_output_surface.cc content/browser/compositor/browser_compositor_output_surface.cc
2
index 0a1231d4e16c..11e1cbc521d4 100644
3 4
--- content/browser/compositor/browser_compositor_output_surface.cc
+++ content/browser/compositor/browser_compositor_output_surface.cc
5
@@ -53,6 +53,10 @@ void BrowserCompositorOutputSurface::SetReflector(ReflectorImpl* reflector) {
6 7 8 9 10 11 12 13 14 15 16
   OnReflectorChanged();
 }
 
+void* BrowserCompositorOutputSurface::GetSharedTexture() const {
+  return nullptr;
+}
+
 void BrowserCompositorOutputSurface::OnReflectorChanged() {
 }
 
diff --git content/browser/compositor/browser_compositor_output_surface.h content/browser/compositor/browser_compositor_output_surface.h
17
index 3c4d448b972f..fa3f01f59484 100644
18 19
--- content/browser/compositor/browser_compositor_output_surface.h
+++ content/browser/compositor/browser_compositor_output_surface.h
20
@@ -40,6 +40,8 @@ class CONTENT_EXPORT BrowserCompositorOutputSurface
21 22 23 24 25 26 27 28 29
 
   void SetReflector(ReflectorImpl* reflector);
 
+  virtual void* GetSharedTexture() const;
+
   // Called when |reflector_| was updated.
   virtual void OnReflectorChanged();
 
diff --git content/browser/compositor/gpu_process_transport_factory.cc content/browser/compositor/gpu_process_transport_factory.cc
30
index 4768ac1a3bac..9432533a3db2 100644
31 32
--- content/browser/compositor/gpu_process_transport_factory.cc
+++ content/browser/compositor/gpu_process_transport_factory.cc
33
@@ -209,6 +209,18 @@ GpuProcessTransportFactory::~GpuProcessTransportFactory() {
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
   task_graph_runner_->Shutdown();
 }
 
+void* GpuProcessTransportFactory::GetSharedTexture(ui::Compositor* compositor) {
+  PerCompositorDataMap::iterator it = per_compositor_data_.find(compositor);
+  if (it == per_compositor_data_.end())
+    return nullptr;
+  PerCompositorData* data = it->second.get();
+  DCHECK(data);
+
+  if (data->display_output_surface)
+    return data->display_output_surface->GetSharedTexture();
+  return nullptr;
+}
+
 std::unique_ptr<viz::SoftwareOutputDevice>
 GpuProcessTransportFactory::CreateSoftwareOutputDevice(
     gfx::AcceleratedWidget widget,
52
@@ -452,11 +464,20 @@ void GpuProcessTransportFactory::EstablishedGpuChannel(
53 54 55 56 57 58 59 60 61 62 63 64 65
       // surfaces as they are not following the correct mode.
       DisableGpuCompositing(compositor.get());
     }
+
+    std::unique_ptr<viz::SoftwareOutputDevice> output_device;
+    if (compositor->delegate()) {
+      output_device = compositor->delegate()->CreateSoftwareOutputDevice(
+          compositor.get());
+    }
+    if (!output_device) {
+      output_device = CreateSoftwareOutputDevice(compositor->widget(),
+                                                 compositor->task_runner());
+    }
66
+
67 68 69 70 71 72 73 74 75
     display_output_surface =
         std::make_unique<SoftwareBrowserCompositorOutputSurface>(
-            CreateSoftwareOutputDevice(compositor->widget(),
-                                       compositor->task_runner()),
-            std::move(vsync_callback));
+            std::move(output_device), std::move(vsync_callback));
   } else {
     DCHECK(context_provider);
     const auto& capabilities = context_provider->ContextCapabilities();
76
@@ -464,7 +485,8 @@ void GpuProcessTransportFactory::EstablishedGpuChannel(
77
       display_output_surface =
78 79 80 81 82 83
           std::make_unique<OffscreenBrowserCompositorOutputSurface>(
               context_provider, std::move(vsync_callback),
-              std::unique_ptr<viz::CompositorOverlayCandidateValidator>());
+              std::unique_ptr<viz::CompositorOverlayCandidateValidator>(),
+              compositor->shared_texture_enabled());
     } else if (capabilities.surfaceless) {
84
 #if defined(OS_MACOSX)
85
       const auto& gpu_feature_info = context_provider->GetGpuFeatureInfo();
86
@@ -909,7 +931,8 @@ GpuProcessTransportFactory::CreatePerCompositorData(
87 88 89 90 91 92 93 94 95 96
   gfx::AcceleratedWidget widget = compositor->widget();
 
   auto data = std::make_unique<PerCompositorData>();
-  if (widget == gfx::kNullAcceleratedWidget) {
+  if (widget == gfx::kNullAcceleratedWidget ||
+      compositor->shared_texture_enabled()) {
     data->surface_handle = gpu::kNullSurfaceHandle;
   } else {
 #if defined(GPU_SURFACE_HANDLE_IS_ACCELERATED_WINDOW)
diff --git content/browser/compositor/gpu_process_transport_factory.h content/browser/compositor/gpu_process_transport_factory.h
97
index 4c4548058be5..335099597a9d 100644
98 99
--- content/browser/compositor/gpu_process_transport_factory.h
+++ content/browser/compositor/gpu_process_transport_factory.h
100
@@ -99,6 +99,7 @@ class GpuProcessTransportFactory : public ui::ContextFactory,
101 102 103 104 105 106 107 108
   void IssueExternalBeginFrame(ui::Compositor* compositor,
                                const viz::BeginFrameArgs& args) override;
   void SetOutputIsSecure(ui::Compositor* compositor, bool secure) override;
+  void* GetSharedTexture(ui::Compositor* compositor) override;
 
   // ImageTransportFactory implementation.
   void DisableGpuCompositing() override;
diff --git content/browser/compositor/offscreen_browser_compositor_output_surface.cc content/browser/compositor/offscreen_browser_compositor_output_surface.cc
109
index e719683c37e9..a51294913fc4 100644
110 111
--- content/browser/compositor/offscreen_browser_compositor_output_surface.cc
+++ content/browser/compositor/offscreen_browser_compositor_output_surface.cc
112
@@ -34,10 +34,12 @@ OffscreenBrowserCompositorOutputSurface::
113 114 115 116 117 118 119 120 121 122 123 124 125
         scoped_refptr<ws::ContextProviderCommandBuffer> context,
         const UpdateVSyncParametersCallback& update_vsync_parameters_callback,
         std::unique_ptr<viz::CompositorOverlayCandidateValidator>
-            overlay_candidate_validator)
+            overlay_candidate_validator,
+        bool shared_texture_enabled)
     : BrowserCompositorOutputSurface(std::move(context),
                                      update_vsync_parameters_callback,
                                      std::move(overlay_candidate_validator)),
+      shared_texture_enabled_(shared_texture_enabled),
       weak_ptr_factory_(this) {
   capabilities_.uses_default_gl_framebuffer = false;
 }
126
@@ -47,6 +49,10 @@ OffscreenBrowserCompositorOutputSurface::
127 128 129 130 131 132 133 134 135 136
   DiscardBackbuffer();
 }
 
+void* OffscreenBrowserCompositorOutputSurface::GetSharedTexture() const {
+  return (void*)shared_handle_;
+}
+
 void OffscreenBrowserCompositorOutputSurface::BindToClient(
     viz::OutputSurfaceClient* client) {
   DCHECK(client);
137
@@ -55,42 +61,72 @@ void OffscreenBrowserCompositorOutputSurface::BindToClient(
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
 }
 
 void OffscreenBrowserCompositorOutputSurface::EnsureBackbuffer() {
-  bool update_source_texture = !reflector_texture_ || reflector_changed_;
-  reflector_changed_ = false;
-  if (!reflector_texture_) {
-    reflector_texture_.reset(new ReflectorTexture(context_provider()));
-
-    GLES2Interface* gl = context_provider_->ContextGL();
-
-    const int max_texture_size =
-        context_provider_->ContextCapabilities().max_texture_size;
-    int texture_width = std::min(max_texture_size, reshape_size_.width());
-    int texture_height = std::min(max_texture_size, reshape_size_.height());
-
-    gl->BindTexture(GL_TEXTURE_2D, reflector_texture_->texture_id());
-    gl->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
-    gl->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
-    gl->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
-    gl->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
-    gl->TexImage2D(GL_TEXTURE_2D, 0, GLInternalFormat(kFboTextureFormat),
-                   texture_width, texture_height, 0,
-                   GLDataFormat(kFboTextureFormat),
-                   GLDataType(kFboTextureFormat), nullptr);
+  GLES2Interface* gl = context_provider_->ContextGL();
+
+  const int max_texture_size =
+      context_provider_->ContextCapabilities().max_texture_size;
+  int texture_width = std::min(max_texture_size, reshape_size_.width());
+  int texture_height = std::min(max_texture_size, reshape_size_.height());
+
+  GLuint color_attachment = 0;
+
+  if (shared_texture_enabled_) {
+    if (!shared_handle_ && (texture_width > 0) && (texture_height > 0)) {
+      gl->GenTextures(1, &shared_texture_);
+      gl->BindTexture(GL_TEXTURE_2D, shared_texture_);
+      gl->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+      gl->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+      gl->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+      gl->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+      shared_handle_ = gl->CreateSharedTexture(shared_texture_, texture_width,
+                                               texture_height);
+
+      if (shared_handle_) {
+        color_attachment = shared_texture_;
+      } else {
+        gl->DeleteTextures(1, &shared_texture_);
+        shared_texture_ = 0;
+      }
+    }
+  } else {
+    // The shared texture code above in theory could work with the reflector
+    // texture However, there were issues making associating it a shared surface
+    // and then attaching it to the FBO (incomplete?)
+    bool update_source_texture = !reflector_texture_ || reflector_changed_;
+    reflector_changed_ = false;
+    if (!reflector_texture_) {
+      reflector_texture_.reset(new ReflectorTexture(context_provider()));
+
+      gl->BindTexture(GL_TEXTURE_2D, reflector_texture_->texture_id());
+      gl->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+      gl->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+      gl->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+      gl->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+      gl->TexImage2D(GL_TEXTURE_2D, 0, GLInternalFormat(kFboTextureFormat),
+                     texture_width, texture_height, 0,
+                     GLDataFormat(kFboTextureFormat),
+                     GLDataType(kFboTextureFormat), nullptr);
+
+      color_attachment = reflector_texture_->texture_id();
+
+      // The reflector may be created later or detached and re-attached,
+      // so don't assume it always exists. For example, ChromeOS always
+      // creates a reflector asynchronosly when creating this for software
+      // mirroring.  See |DisplayManager::CreateMirrorWindowAsyncIfAny|.
+      if (reflector_ && update_source_texture)
+        reflector_->OnSourceTextureMailboxUpdated(
+            reflector_texture_->mailbox());
+    }
+  }
+
+  if (color_attachment) {
     if (!fbo_)
       gl->GenFramebuffers(1, &fbo_);
 
     gl->BindFramebuffer(GL_FRAMEBUFFER, fbo_);
     gl->FramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
-                             GL_TEXTURE_2D, reflector_texture_->texture_id(),
-                             0);
+                             GL_TEXTURE_2D, color_attachment, 0);
   }
-
-  // The reflector may be created later or detached and re-attached,
-  // so don't assume it always exists. For example, ChromeOS always
-  // creates a reflector asynchronosly when creating this for software
-  // mirroring.  See |DisplayManager::CreateMirrorWindowAsyncIfAny|.
-  if (reflector_ && update_source_texture)
-    reflector_->OnSourceTextureMailboxUpdated(reflector_texture_->mailbox());
 }
 
 void OffscreenBrowserCompositorOutputSurface::DiscardBackbuffer() {
240
@@ -102,6 +138,16 @@ void OffscreenBrowserCompositorOutputSurface::DiscardBackbuffer() {
241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256
       reflector_->OnSourceTextureMailboxUpdated(nullptr);
   }
 
+  if (shared_handle_) {
+    gl->DeleteSharedTexture(shared_handle_);
+    shared_handle_ = 0ull;
+  }
+
+  if (shared_texture_) {
+    gl->DeleteTextures(1, &shared_texture_);
+    shared_texture_ = 0;
+  }
+
   if (fbo_) {
     gl->BindFramebuffer(GL_FRAMEBUFFER, fbo_);
     gl->DeleteFramebuffers(1, &fbo_);
257
@@ -124,15 +170,20 @@ void OffscreenBrowserCompositorOutputSurface::Reshape(
258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281
 }
 
 void OffscreenBrowserCompositorOutputSurface::BindFramebuffer() {
-  bool need_to_bind = !!reflector_texture_.get();
+  GLES2Interface* gl = context_provider_->ContextGL();
 
+  bool need_to_bind = !!reflector_texture_.get();
   EnsureBackbuffer();
-  DCHECK(reflector_texture_.get());
   DCHECK(fbo_);
 
-  if (need_to_bind) {
-    GLES2Interface* gl = context_provider_->ContextGL();
+  if (shared_handle_) {
     gl->BindFramebuffer(GL_FRAMEBUFFER, fbo_);
+    gl->LockSharedTexture(shared_handle_);
+  } else {
+    DCHECK(reflector_texture_.get());
+    if (need_to_bind) {
+      gl->BindFramebuffer(GL_FRAMEBUFFER, fbo_);
+    }
   }
 }
 
282
@@ -153,6 +204,12 @@ void OffscreenBrowserCompositorOutputSurface::SwapBuffers(
283 284 285 286 287 288 289 290 291 292 293 294
   // The original implementation had a flickering issue (crbug.com/515332).
   gpu::gles2::GLES2Interface* gl = context_provider_->ContextGL();
 
+  // If using a shared texture we need to Flush.
+  if (shared_handle_) {
+    gl->UnlockSharedTexture(shared_handle_);
+    gl->Flush();
+  }
+
   gpu::SyncToken sync_token;
   gl->GenUnverifiedSyncTokenCHROMIUM(sync_token.GetData());
   context_provider_->ContextSupport()->SignalSyncToken(
295
@@ -192,7 +249,9 @@ void OffscreenBrowserCompositorOutputSurface::OnSwapBuffersComplete(
296
     const std::vector<ui::LatencyInfo>& latency_info) {
297 298
   latency_tracker_.OnGpuSwapBuffersCompleted(latency_info);
   client_->DidReceiveSwapBuffersAck();
299 300 301 302
-  client_->DidReceivePresentationFeedback(gfx::PresentationFeedback());
+  gfx::PresentationFeedback feedback;
+  feedback.timestamp = base::TimeTicks::Now();
+  client_->DidReceivePresentationFeedback(feedback);
303 304
 }
 
305
 unsigned OffscreenBrowserCompositorOutputSurface::UpdateGpuFence() {
306
diff --git content/browser/compositor/offscreen_browser_compositor_output_surface.h content/browser/compositor/offscreen_browser_compositor_output_surface.h
307
index 71830777ae56..6a0857b02a04 100644
308 309
--- content/browser/compositor/offscreen_browser_compositor_output_surface.h
+++ content/browser/compositor/offscreen_browser_compositor_output_surface.h
310
@@ -31,7 +31,8 @@ class OffscreenBrowserCompositorOutputSurface
311 312 313 314 315 316 317 318 319
       scoped_refptr<ws::ContextProviderCommandBuffer> context,
       const UpdateVSyncParametersCallback& update_vsync_parameters_callback,
       std::unique_ptr<viz::CompositorOverlayCandidateValidator>
-          overlay_candidate_validator);
+          overlay_candidate_validator,
+      bool shared_texture_enabled);
 
   ~OffscreenBrowserCompositorOutputSurface() override;
 
320
@@ -53,11 +54,15 @@ class OffscreenBrowserCompositorOutputSurface
321 322 323 324 325 326 327 328 329 330 331 332
   gfx::BufferFormat GetOverlayBufferFormat() const override;
   uint32_t GetFramebufferCopyTextureFormat() override;
 
+  void* GetSharedTexture() const override;
+
   // BrowserCompositorOutputSurface implementation.
   void OnReflectorChanged() override;
 
   unsigned UpdateGpuFence() override;
 
+  void NotifyRenderHost(const std::vector<ui::LatencyInfo>& latency_info);
+
333
   void OnSwapBuffersComplete(const std::vector<ui::LatencyInfo>& latency_info);
334
 
335
   viz::OutputSurfaceClient* client_ = nullptr;
336
@@ -65,6 +70,11 @@ class OffscreenBrowserCompositorOutputSurface
337 338 339 340 341 342 343 344 345 346 347 348
   uint32_t fbo_ = 0;
   bool reflector_changed_ = false;
   std::unique_ptr<ReflectorTexture> reflector_texture_;
+
+  bool shared_texture_enabled_ = false;
+  uint64_t shared_handle_ = 0ull;
+  uint32_t shared_texture_ = 0;
+
   ui::LatencyTracker latency_tracker_;
   base::WeakPtrFactory<OffscreenBrowserCompositorOutputSurface>
       weak_ptr_factory_;
diff --git gpu/GLES2/gl2chromium_autogen.h gpu/GLES2/gl2chromium_autogen.h
349
index 404c05cee78b..d2ce3e8de6e9 100644
350 351
--- gpu/GLES2/gl2chromium_autogen.h
+++ gpu/GLES2/gl2chromium_autogen.h
352
@@ -416,6 +416,10 @@
353 354 355 356 357 358 359 360 361 362 363
   GLES2_GET_FUN(CreateClientGpuFenceCHROMIUM)
 #define glWaitGpuFenceCHROMIUM GLES2_GET_FUN(WaitGpuFenceCHROMIUM)
 #define glDestroyGpuFenceCHROMIUM GLES2_GET_FUN(DestroyGpuFenceCHROMIUM)
+#define glCreateSharedTexture GLES2_GET_FUN(CreateSharedTexture)
+#define glLockSharedTexture GLES2_GET_FUN(LockSharedTexture)
+#define glUnlockSharedTexture GLES2_GET_FUN(UnlockSharedTexture)
+#define glDeleteSharedTexture GLES2_GET_FUN(DeleteSharedTexture)
 #define glInvalidateReadbackBufferShadowDataCHROMIUM \
   GLES2_GET_FUN(InvalidateReadbackBufferShadowDataCHROMIUM)
 #define glFramebufferTextureMultiviewLayeredANGLE \
diff --git gpu/command_buffer/build_gles2_cmd_buffer.py gpu/command_buffer/build_gles2_cmd_buffer.py
364
index 4032b2491109..02639f9b2080 100755
365 366
--- gpu/command_buffer/build_gles2_cmd_buffer.py
+++ gpu/command_buffer/build_gles2_cmd_buffer.py
367
@@ -4254,6 +4254,35 @@ _FUNCTION_INFO = {
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
     'extension': 'CHROMIUM_gpu_fence',
     'extension_flag': 'chromium_gpu_fence',
   },
+  'CreateSharedTexture': {
+    'type': 'Custom',
+    'data_transfer_methods': ['shm'],
+    'cmd_args': 'GLint texture_id, GLint width, '
+                'GLint height, GLuint64* result',
+    'result': ['GLuint64'],
+    'unit_test': False,
+    'impl_func': False,
+    'client_test': False,
+    'extension': True,
+  },
+  'LockSharedTexture': {
+    'type': 'Custom',
+    'unit_test': False,
+    'client_test': False,
+    'extension': True,
+  },
+  'UnlockSharedTexture': {
+    'type': 'Custom',
+    'unit_test': False,
+    'client_test': False,
+    'extension': True,
+  },
+  'DeleteSharedTexture': {
+    'type': 'Custom',
+    'unit_test': False,
+    'client_test': False,
+    'extension': True,
+  },
   'UnpremultiplyAndDitherCopyCHROMIUM': {
     'decoder_func': 'DoUnpremultiplyAndDitherCopyCHROMIUM',
     'cmd_args': 'GLuint source_id, GLuint dest_id, GLint x, GLint y, '
diff --git gpu/command_buffer/client/gles2_c_lib_autogen.h gpu/command_buffer/client/gles2_c_lib_autogen.h
404
index b68942087179..2248762fcd77 100644
405 406
--- gpu/command_buffer/client/gles2_c_lib_autogen.h
+++ gpu/command_buffer/client/gles2_c_lib_autogen.h
407
@@ -1909,6 +1909,20 @@ void GL_APIENTRY GLES2WaitGpuFenceCHROMIUM(GLuint gpu_fence_id) {
408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427
 void GL_APIENTRY GLES2DestroyGpuFenceCHROMIUM(GLuint gpu_fence_id) {
   gles2::GetGLContext()->DestroyGpuFenceCHROMIUM(gpu_fence_id);
 }
+GLuint64 GL_APIENTRY GLES2CreateSharedTexture(GLuint texture_id,
+                                              GLsizei width,
+                                              GLsizei height) {
+  return gles2::GetGLContext()->CreateSharedTexture(texture_id, width, height);
+}
+void GL_APIENTRY GLES2LockSharedTexture(GLuint64 shared_handle) {
+  gles2::GetGLContext()->LockSharedTexture(shared_handle);
+}
+void GL_APIENTRY GLES2UnlockSharedTexture(GLuint64 shared_handle) {
+  gles2::GetGLContext()->UnlockSharedTexture(shared_handle);
+}
+void GL_APIENTRY GLES2DeleteSharedTexture(GLuint64 shared_handle) {
+  gles2::GetGLContext()->DeleteSharedTexture(shared_handle);
+}
 void GL_APIENTRY
 GLES2InvalidateReadbackBufferShadowDataCHROMIUM(GLuint buffer_id) {
   gles2::GetGLContext()->InvalidateReadbackBufferShadowDataCHROMIUM(buffer_id);
428
@@ -3434,6 +3448,22 @@ extern const NameToFunc g_gles2_function_table[] = {
429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451
         "glDestroyGpuFenceCHROMIUM",
         reinterpret_cast<GLES2FunctionPointer>(glDestroyGpuFenceCHROMIUM),
     },
+    {
+        "glCreateSharedTexture",
+        reinterpret_cast<GLES2FunctionPointer>(glCreateSharedTexture),
+    },
+    {
+        "glLockSharedTexture",
+        reinterpret_cast<GLES2FunctionPointer>(glLockSharedTexture),
+    },
+    {
+        "glUnlockSharedTexture",
+        reinterpret_cast<GLES2FunctionPointer>(glUnlockSharedTexture),
+    },
+    {
+        "glDeleteSharedTexture",
+        reinterpret_cast<GLES2FunctionPointer>(glDeleteSharedTexture),
+    },
     {
         "glInvalidateReadbackBufferShadowDataCHROMIUM",
         reinterpret_cast<GLES2FunctionPointer>(
diff --git gpu/command_buffer/client/gles2_cmd_helper_autogen.h gpu/command_buffer/client/gles2_cmd_helper_autogen.h
452
index 02f89cdad67c..a2da1b7c518a 100644
453 454
--- gpu/command_buffer/client/gles2_cmd_helper_autogen.h
+++ gpu/command_buffer/client/gles2_cmd_helper_autogen.h
455
@@ -3521,6 +3521,42 @@ void DestroyGpuFenceCHROMIUM(GLuint gpu_fence_id) {
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
   }
 }
 
+void CreateSharedTexture(GLint texture_id,
+                         GLint width,
+                         GLint height,
+                         uint32_t result_shm_id,
+                         uint32_t result_shm_offset) {
+  gles2::cmds::CreateSharedTexture* c =
+      GetCmdSpace<gles2::cmds::CreateSharedTexture>();
+  if (c) {
+    c->Init(texture_id, width, height, result_shm_id, result_shm_offset);
+  }
+}
+
+void LockSharedTexture(GLuint64 shared_handle) {
+  gles2::cmds::LockSharedTexture* c =
+      GetCmdSpace<gles2::cmds::LockSharedTexture>();
+  if (c) {
+    c->Init(shared_handle);
+  }
+}
+
+void UnlockSharedTexture(GLuint64 shared_handle) {
+  gles2::cmds::UnlockSharedTexture* c =
+      GetCmdSpace<gles2::cmds::UnlockSharedTexture>();
+  if (c) {
+    c->Init(shared_handle);
+  }
+}
+
+void DeleteSharedTexture(GLuint64 shared_handle) {
+  gles2::cmds::DeleteSharedTexture* c =
+      GetCmdSpace<gles2::cmds::DeleteSharedTexture>();
+  if (c) {
+    c->Init(shared_handle);
+  }
+}
+
 void SetReadbackBufferShadowAllocationINTERNAL(GLuint buffer_id,
                                                GLint shm_id,
                                                GLuint shm_offset,
diff --git gpu/command_buffer/client/gles2_implementation.cc gpu/command_buffer/client/gles2_implementation.cc
499
index 985e6324567b..d2e067f28521 100644
500 501
--- gpu/command_buffer/client/gles2_implementation.cc
+++ gpu/command_buffer/client/gles2_implementation.cc
502
@@ -7680,6 +7680,22 @@ void GLES2Implementation::Viewport(GLint x,
503 504 505 506 507 508 509
   CheckGLError();
 }
 
+GLuint64 GLES2Implementation::CreateSharedTexture(GLuint texture_id,
+                                                  GLsizei width,
+                                                  GLsizei height) {
+  typedef cmds::CreateSharedTexture::Result Result;
510
+  auto result = GetResultAs<Result>();
511 512 513 514 515
+  if (!result) {
+    return 0;
+  }
+  *result = 0;
+  helper_->CreateSharedTexture(texture_id, width, height, GetResultShmId(),
516
+                               result.offset());
517 518 519 520 521 522 523 524 525
+
+  WaitForCmd();
+  return *result;
+}
+
 void GLES2Implementation::IssueBeginQuery(GLenum target,
                                           GLuint id,
                                           uint32_t sync_data_shm_id,
diff --git gpu/command_buffer/client/gles2_implementation_autogen.h gpu/command_buffer/client/gles2_implementation_autogen.h
526
index 6882d12a79c4..b237ee953860 100644
527 528
--- gpu/command_buffer/client/gles2_implementation_autogen.h
+++ gpu/command_buffer/client/gles2_implementation_autogen.h
529
@@ -1345,6 +1345,16 @@ void WaitGpuFenceCHROMIUM(GLuint gpu_fence_id) override;
530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546
 
 void DestroyGpuFenceCHROMIUM(GLuint gpu_fence_id) override;
 
+GLuint64 CreateSharedTexture(GLuint texture_id,
+                             GLsizei width,
+                             GLsizei height) override;
+
+void LockSharedTexture(GLuint64 shared_handle) override;
+
+void UnlockSharedTexture(GLuint64 shared_handle) override;
+
+void DeleteSharedTexture(GLuint64 shared_handle) override;
+
 void InvalidateReadbackBufferShadowDataCHROMIUM(GLuint buffer_id) override;
 
 void FramebufferTextureMultiviewLayeredANGLE(GLenum target,
diff --git gpu/command_buffer/client/gles2_implementation_impl_autogen.h gpu/command_buffer/client/gles2_implementation_impl_autogen.h
547
index 13b36769ae3d..d2351bb96021 100644
548 549
--- gpu/command_buffer/client/gles2_implementation_impl_autogen.h
+++ gpu/command_buffer/client/gles2_implementation_impl_autogen.h
550
@@ -3790,6 +3790,30 @@ void GLES2Implementation::DestroyGpuFenceCHROMIUM(GLuint gpu_fence_id) {
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
   CheckGLError();
 }
 
+void GLES2Implementation::LockSharedTexture(GLuint64 shared_handle) {
+  GPU_CLIENT_SINGLE_THREAD_CHECK();
+  GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glLockSharedTexture("
+                     << shared_handle << ")");
+  helper_->LockSharedTexture(shared_handle);
+  CheckGLError();
+}
+
+void GLES2Implementation::UnlockSharedTexture(GLuint64 shared_handle) {
+  GPU_CLIENT_SINGLE_THREAD_CHECK();
+  GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glUnlockSharedTexture("
+                     << shared_handle << ")");
+  helper_->UnlockSharedTexture(shared_handle);
+  CheckGLError();
+}
+
+void GLES2Implementation::DeleteSharedTexture(GLuint64 shared_handle) {
+  GPU_CLIENT_SINGLE_THREAD_CHECK();
+  GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glDeleteSharedTexture("
+                     << shared_handle << ")");
+  helper_->DeleteSharedTexture(shared_handle);
+  CheckGLError();
+}
+
 void GLES2Implementation::FramebufferTextureMultiviewLayeredANGLE(
     GLenum target,
     GLenum attachment,
diff --git gpu/command_buffer/client/gles2_interface_autogen.h gpu/command_buffer/client/gles2_interface_autogen.h
582
index 2071473f0da8..77a29e65cafd 100644
583 584
--- gpu/command_buffer/client/gles2_interface_autogen.h
+++ gpu/command_buffer/client/gles2_interface_autogen.h
585
@@ -1010,6 +1010,12 @@ virtual GLuint CreateGpuFenceCHROMIUM() = 0;
586 587 588 589 590 591 592 593 594 595 596 597 598
 virtual GLuint CreateClientGpuFenceCHROMIUM(ClientGpuFence source) = 0;
 virtual void WaitGpuFenceCHROMIUM(GLuint gpu_fence_id) = 0;
 virtual void DestroyGpuFenceCHROMIUM(GLuint gpu_fence_id) = 0;
+virtual GLuint64 CreateSharedTexture(GLuint texture_id,
+                                     GLsizei width,
+                                     GLsizei height) = 0;
+virtual void LockSharedTexture(GLuint64 shared_handle) = 0;
+virtual void UnlockSharedTexture(GLuint64 shared_handle) = 0;
+virtual void DeleteSharedTexture(GLuint64 shared_handle) = 0;
 virtual void InvalidateReadbackBufferShadowDataCHROMIUM(GLuint buffer_id) = 0;
 virtual void FramebufferTextureMultiviewLayeredANGLE(GLenum target,
                                                      GLenum attachment,
diff --git gpu/command_buffer/client/gles2_interface_stub_autogen.h gpu/command_buffer/client/gles2_interface_stub_autogen.h
599
index 158134cf608e..2990494dcc5e 100644
600 601
--- gpu/command_buffer/client/gles2_interface_stub_autogen.h
+++ gpu/command_buffer/client/gles2_interface_stub_autogen.h
602
@@ -980,6 +980,12 @@ GLuint CreateGpuFenceCHROMIUM() override;
603 604 605 606 607 608 609 610 611 612 613 614 615
 GLuint CreateClientGpuFenceCHROMIUM(ClientGpuFence source) override;
 void WaitGpuFenceCHROMIUM(GLuint gpu_fence_id) override;
 void DestroyGpuFenceCHROMIUM(GLuint gpu_fence_id) override;
+GLuint64 CreateSharedTexture(GLuint texture_id,
+                             GLsizei width,
+                             GLsizei height) override;
+void LockSharedTexture(GLuint64 shared_handle) override;
+void UnlockSharedTexture(GLuint64 shared_handle) override;
+void DeleteSharedTexture(GLuint64 shared_handle) override;
 void InvalidateReadbackBufferShadowDataCHROMIUM(GLuint buffer_id) override;
 void FramebufferTextureMultiviewLayeredANGLE(GLenum target,
                                              GLenum attachment,
diff --git gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h
616
index 29d079725c72..444c60df71a4 100644
617 618
--- gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h
+++ gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h
619
@@ -1303,6 +1303,14 @@ GLuint GLES2InterfaceStub::CreateClientGpuFenceCHROMIUM(
620 621 622 623 624 625 626 627 628 629 630 631 632 633 634
 }
 void GLES2InterfaceStub::WaitGpuFenceCHROMIUM(GLuint /* gpu_fence_id */) {}
 void GLES2InterfaceStub::DestroyGpuFenceCHROMIUM(GLuint /* gpu_fence_id */) {}
+GLuint64 GLES2InterfaceStub::CreateSharedTexture(GLuint /* texture_id */,
+                                                 GLsizei /* width */,
+                                                 GLsizei /* height */) {
+  return 0;
+}
+void GLES2InterfaceStub::LockSharedTexture(GLuint64 /* shared_handle */) {}
+void GLES2InterfaceStub::UnlockSharedTexture(GLuint64 /* shared_handle */) {}
+void GLES2InterfaceStub::DeleteSharedTexture(GLuint64 /* shared_handle */) {}
 void GLES2InterfaceStub::InvalidateReadbackBufferShadowDataCHROMIUM(
     GLuint /* buffer_id */) {}
 void GLES2InterfaceStub::FramebufferTextureMultiviewLayeredANGLE(
diff --git gpu/command_buffer/client/gles2_trace_implementation_autogen.h gpu/command_buffer/client/gles2_trace_implementation_autogen.h
635
index 7e94db26455d..d9de7879ea9a 100644
636 637
--- gpu/command_buffer/client/gles2_trace_implementation_autogen.h
+++ gpu/command_buffer/client/gles2_trace_implementation_autogen.h
638
@@ -980,6 +980,12 @@ GLuint CreateGpuFenceCHROMIUM() override;
639 640 641 642 643 644 645 646 647 648 649 650 651
 GLuint CreateClientGpuFenceCHROMIUM(ClientGpuFence source) override;
 void WaitGpuFenceCHROMIUM(GLuint gpu_fence_id) override;
 void DestroyGpuFenceCHROMIUM(GLuint gpu_fence_id) override;
+GLuint64 CreateSharedTexture(GLuint texture_id,
+                             GLsizei width,
+                             GLsizei height) override;
+void LockSharedTexture(GLuint64 shared_handle) override;
+void UnlockSharedTexture(GLuint64 shared_handle) override;
+void DeleteSharedTexture(GLuint64 shared_handle) override;
 void InvalidateReadbackBufferShadowDataCHROMIUM(GLuint buffer_id) override;
 void FramebufferTextureMultiviewLayeredANGLE(GLenum target,
                                              GLenum attachment,
diff --git gpu/command_buffer/client/gles2_trace_implementation_impl_autogen.h gpu/command_buffer/client/gles2_trace_implementation_impl_autogen.h
652
index 4b7932e147b0..b0f5f2cafae3 100644
653 654
--- gpu/command_buffer/client/gles2_trace_implementation_impl_autogen.h
+++ gpu/command_buffer/client/gles2_trace_implementation_impl_autogen.h
655
@@ -2747,6 +2747,28 @@ void GLES2TraceImplementation::DestroyGpuFenceCHROMIUM(GLuint gpu_fence_id) {
656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684
   gl_->DestroyGpuFenceCHROMIUM(gpu_fence_id);
 }
 
+GLuint64 GLES2TraceImplementation::CreateSharedTexture(GLuint texture_id,
+                                                       GLsizei width,
+                                                       GLsizei height) {
+  TRACE_EVENT_BINARY_EFFICIENT0("gpu", "GLES2Trace::CreateSharedTexture");
+  return gl_->CreateSharedTexture(texture_id, width, height);
+}
+
+void GLES2TraceImplementation::LockSharedTexture(GLuint64 shared_handle) {
+  TRACE_EVENT_BINARY_EFFICIENT0("gpu", "GLES2Trace::LockSharedTexture");
+  gl_->LockSharedTexture(shared_handle);
+}
+
+void GLES2TraceImplementation::UnlockSharedTexture(GLuint64 shared_handle) {
+  TRACE_EVENT_BINARY_EFFICIENT0("gpu", "GLES2Trace::UnlockSharedTexture");
+  gl_->UnlockSharedTexture(shared_handle);
+}
+
+void GLES2TraceImplementation::DeleteSharedTexture(GLuint64 shared_handle) {
+  TRACE_EVENT_BINARY_EFFICIENT0("gpu", "GLES2Trace::DeleteSharedTexture");
+  gl_->DeleteSharedTexture(shared_handle);
+}
+
 void GLES2TraceImplementation::InvalidateReadbackBufferShadowDataCHROMIUM(
     GLuint buffer_id) {
   TRACE_EVENT_BINARY_EFFICIENT0(
diff --git gpu/command_buffer/common/gles2_cmd_format_autogen.h gpu/command_buffer/common/gles2_cmd_format_autogen.h
685
index 68d9861198e0..98e8772b2993 100644
686 687
--- gpu/command_buffer/common/gles2_cmd_format_autogen.h
+++ gpu/command_buffer/common/gles2_cmd_format_autogen.h
688
@@ -17336,6 +17336,193 @@ static_assert(offsetof(DestroyGpuFenceCHROMIUM, header) == 0,
689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882
 static_assert(offsetof(DestroyGpuFenceCHROMIUM, gpu_fence_id) == 4,
               "offset of DestroyGpuFenceCHROMIUM gpu_fence_id should be 4");
 
+struct CreateSharedTexture {
+  typedef CreateSharedTexture ValueType;
+  static const CommandId kCmdId = kCreateSharedTexture;
+  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
+  static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
+
+  typedef GLuint64 Result;
+
+  static uint32_t ComputeSize() {
+    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
+  }
+
+  void SetHeader() { header.SetCmd<ValueType>(); }
+
+  void Init(GLint _texture_id,
+            GLint _width,
+            GLint _height,
+            uint32_t _result_shm_id,
+            uint32_t _result_shm_offset) {
+    SetHeader();
+    texture_id = _texture_id;
+    width = _width;
+    height = _height;
+    result_shm_id = _result_shm_id;
+    result_shm_offset = _result_shm_offset;
+  }
+
+  void* Set(void* cmd,
+            GLint _texture_id,
+            GLint _width,
+            GLint _height,
+            uint32_t _result_shm_id,
+            uint32_t _result_shm_offset) {
+    static_cast<ValueType*>(cmd)->Init(_texture_id, _width, _height,
+                                       _result_shm_id, _result_shm_offset);
+    return NextCmdAddress<ValueType>(cmd);
+  }
+
+  gpu::CommandHeader header;
+  int32_t texture_id;
+  int32_t width;
+  int32_t height;
+  uint32_t result_shm_id;
+  uint32_t result_shm_offset;
+};
+
+static_assert(sizeof(CreateSharedTexture) == 24,
+              "size of CreateSharedTexture should be 24");
+static_assert(offsetof(CreateSharedTexture, header) == 0,
+              "offset of CreateSharedTexture header should be 0");
+static_assert(offsetof(CreateSharedTexture, texture_id) == 4,
+              "offset of CreateSharedTexture texture_id should be 4");
+static_assert(offsetof(CreateSharedTexture, width) == 8,
+              "offset of CreateSharedTexture width should be 8");
+static_assert(offsetof(CreateSharedTexture, height) == 12,
+              "offset of CreateSharedTexture height should be 12");
+static_assert(offsetof(CreateSharedTexture, result_shm_id) == 16,
+              "offset of CreateSharedTexture result_shm_id should be 16");
+static_assert(offsetof(CreateSharedTexture, result_shm_offset) == 20,
+              "offset of CreateSharedTexture result_shm_offset should be 20");
+
+struct LockSharedTexture {
+  typedef LockSharedTexture ValueType;
+  static const CommandId kCmdId = kLockSharedTexture;
+  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
+  static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
+
+  static uint32_t ComputeSize() {
+    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
+  }
+
+  void SetHeader() { header.SetCmd<ValueType>(); }
+
+  void Init(GLuint64 _shared_handle) {
+    SetHeader();
+    GLES2Util::MapUint64ToTwoUint32(static_cast<uint64_t>(_shared_handle),
+                                    &shared_handle_0, &shared_handle_1);
+  }
+
+  void* Set(void* cmd, GLuint64 _shared_handle) {
+    static_cast<ValueType*>(cmd)->Init(_shared_handle);
+    return NextCmdAddress<ValueType>(cmd);
+  }
+
+  GLuint64 shared_handle() const volatile {
+    return static_cast<GLuint64>(
+        GLES2Util::MapTwoUint32ToUint64(shared_handle_0, shared_handle_1));
+  }
+
+  gpu::CommandHeader header;
+  uint32_t shared_handle_0;
+  uint32_t shared_handle_1;
+};
+
+static_assert(sizeof(LockSharedTexture) == 12,
+              "size of LockSharedTexture should be 12");
+static_assert(offsetof(LockSharedTexture, header) == 0,
+              "offset of LockSharedTexture header should be 0");
+static_assert(offsetof(LockSharedTexture, shared_handle_0) == 4,
+              "offset of LockSharedTexture shared_handle_0 should be 4");
+static_assert(offsetof(LockSharedTexture, shared_handle_1) == 8,
+              "offset of LockSharedTexture shared_handle_1 should be 8");
+
+struct UnlockSharedTexture {
+  typedef UnlockSharedTexture ValueType;
+  static const CommandId kCmdId = kUnlockSharedTexture;
+  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
+  static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
+
+  static uint32_t ComputeSize() {
+    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
+  }
+
+  void SetHeader() { header.SetCmd<ValueType>(); }
+
+  void Init(GLuint64 _shared_handle) {
+    SetHeader();
+    GLES2Util::MapUint64ToTwoUint32(static_cast<uint64_t>(_shared_handle),
+                                    &shared_handle_0, &shared_handle_1);
+  }
+
+  void* Set(void* cmd, GLuint64 _shared_handle) {
+    static_cast<ValueType*>(cmd)->Init(_shared_handle);
+    return NextCmdAddress<ValueType>(cmd);
+  }
+
+  GLuint64 shared_handle() const volatile {
+    return static_cast<GLuint64>(
+        GLES2Util::MapTwoUint32ToUint64(shared_handle_0, shared_handle_1));
+  }
+
+  gpu::CommandHeader header;
+  uint32_t shared_handle_0;
+  uint32_t shared_handle_1;
+};
+
+static_assert(sizeof(UnlockSharedTexture) == 12,
+              "size of UnlockSharedTexture should be 12");
+static_assert(offsetof(UnlockSharedTexture, header) == 0,
+              "offset of UnlockSharedTexture header should be 0");
+static_assert(offsetof(UnlockSharedTexture, shared_handle_0) == 4,
+              "offset of UnlockSharedTexture shared_handle_0 should be 4");
+static_assert(offsetof(UnlockSharedTexture, shared_handle_1) == 8,
+              "offset of UnlockSharedTexture shared_handle_1 should be 8");
+
+struct DeleteSharedTexture {
+  typedef DeleteSharedTexture ValueType;
+  static const CommandId kCmdId = kDeleteSharedTexture;
+  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
+  static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
+
+  static uint32_t ComputeSize() {
+    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
+  }
+
+  void SetHeader() { header.SetCmd<ValueType>(); }
+
+  void Init(GLuint64 _shared_handle) {
+    SetHeader();
+    GLES2Util::MapUint64ToTwoUint32(static_cast<uint64_t>(_shared_handle),
+                                    &shared_handle_0, &shared_handle_1);
+  }
+
+  void* Set(void* cmd, GLuint64 _shared_handle) {
+    static_cast<ValueType*>(cmd)->Init(_shared_handle);
+    return NextCmdAddress<ValueType>(cmd);
+  }
+
+  GLuint64 shared_handle() const volatile {
+    return static_cast<GLuint64>(
+        GLES2Util::MapTwoUint32ToUint64(shared_handle_0, shared_handle_1));
+  }
+
+  gpu::CommandHeader header;
+  uint32_t shared_handle_0;
+  uint32_t shared_handle_1;
+};
+
+static_assert(sizeof(DeleteSharedTexture) == 12,
+              "size of DeleteSharedTexture should be 12");
+static_assert(offsetof(DeleteSharedTexture, header) == 0,
+              "offset of DeleteSharedTexture header should be 0");
+static_assert(offsetof(DeleteSharedTexture, shared_handle_0) == 4,
+              "offset of DeleteSharedTexture shared_handle_0 should be 4");
+static_assert(offsetof(DeleteSharedTexture, shared_handle_1) == 8,
+              "offset of DeleteSharedTexture shared_handle_1 should be 8");
+
 struct SetReadbackBufferShadowAllocationINTERNAL {
   typedef SetReadbackBufferShadowAllocationINTERNAL ValueType;
   static const CommandId kCmdId = kSetReadbackBufferShadowAllocationINTERNAL;
diff --git gpu/command_buffer/common/gles2_cmd_format_test_autogen.h gpu/command_buffer/common/gles2_cmd_format_test_autogen.h
883
index 790e72622c7d..bf87d86d9386 100644
884 885
--- gpu/command_buffer/common/gles2_cmd_format_test_autogen.h
+++ gpu/command_buffer/common/gles2_cmd_format_test_autogen.h
886
@@ -5721,6 +5721,52 @@ TEST_F(GLES2FormatTest, DestroyGpuFenceCHROMIUM) {
887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939
   CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
 }
 
+TEST_F(GLES2FormatTest, CreateSharedTexture) {
+  cmds::CreateSharedTexture& cmd = *GetBufferAs<cmds::CreateSharedTexture>();
+  void* next_cmd = cmd.Set(&cmd, static_cast<GLint>(11), static_cast<GLint>(12),
+                           static_cast<GLint>(13), static_cast<uint32_t>(14),
+                           static_cast<uint32_t>(15));
+  EXPECT_EQ(static_cast<uint32_t>(cmds::CreateSharedTexture::kCmdId),
+            cmd.header.command);
+  EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
+  EXPECT_EQ(static_cast<GLint>(11), cmd.texture_id);
+  EXPECT_EQ(static_cast<GLint>(12), cmd.width);
+  EXPECT_EQ(static_cast<GLint>(13), cmd.height);
+  EXPECT_EQ(static_cast<uint32_t>(14), cmd.result_shm_id);
+  EXPECT_EQ(static_cast<uint32_t>(15), cmd.result_shm_offset);
+  CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
+}
+
+TEST_F(GLES2FormatTest, LockSharedTexture) {
+  cmds::LockSharedTexture& cmd = *GetBufferAs<cmds::LockSharedTexture>();
+  void* next_cmd = cmd.Set(&cmd, static_cast<GLuint64>(11));
+  EXPECT_EQ(static_cast<uint32_t>(cmds::LockSharedTexture::kCmdId),
+            cmd.header.command);
+  EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
+  EXPECT_EQ(static_cast<GLuint64>(11), cmd.shared_handle());
+  CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
+}
+
+TEST_F(GLES2FormatTest, UnlockSharedTexture) {
+  cmds::UnlockSharedTexture& cmd = *GetBufferAs<cmds::UnlockSharedTexture>();
+  void* next_cmd = cmd.Set(&cmd, static_cast<GLuint64>(11));
+  EXPECT_EQ(static_cast<uint32_t>(cmds::UnlockSharedTexture::kCmdId),
+            cmd.header.command);
+  EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
+  EXPECT_EQ(static_cast<GLuint64>(11), cmd.shared_handle());
+  CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
+}
+
+TEST_F(GLES2FormatTest, DeleteSharedTexture) {
+  cmds::DeleteSharedTexture& cmd = *GetBufferAs<cmds::DeleteSharedTexture>();
+  void* next_cmd = cmd.Set(&cmd, static_cast<GLuint64>(11));
+  EXPECT_EQ(static_cast<uint32_t>(cmds::DeleteSharedTexture::kCmdId),
+            cmd.header.command);
+  EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
+  EXPECT_EQ(static_cast<GLuint64>(11), cmd.shared_handle());
+  CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
+}
+
 TEST_F(GLES2FormatTest, SetReadbackBufferShadowAllocationINTERNAL) {
   cmds::SetReadbackBufferShadowAllocationINTERNAL& cmd =
       *GetBufferAs<cmds::SetReadbackBufferShadowAllocationINTERNAL>();
diff --git gpu/command_buffer/common/gles2_cmd_ids_autogen.h gpu/command_buffer/common/gles2_cmd_ids_autogen.h
940
index b3dd9b38feba..bcb3656e4481 100644
941 942
--- gpu/command_buffer/common/gles2_cmd_ids_autogen.h
+++ gpu/command_buffer/common/gles2_cmd_ids_autogen.h
943 944 945 946 947 948 949 950 951 952
@@ -361,7 +361,11 @@
   OP(MaxShaderCompilerThreadsKHR)                          /* 602 */ \
   OP(CreateAndTexStorage2DSharedImageINTERNALImmediate)    /* 603 */ \
   OP(BeginSharedImageAccessDirectCHROMIUM)                 /* 604 */ \
-  OP(EndSharedImageAccessDirectCHROMIUM)                   /* 605 */
+  OP(EndSharedImageAccessDirectCHROMIUM)                   /* 605 */ \
+  OP(CreateSharedTexture)                                  /* 606 */ \
+  OP(LockSharedTexture)                                    /* 607 */ \
+  OP(UnlockSharedTexture)                                  /* 608 */ \
+  OP(DeleteSharedTexture)                                  /* 609 */
953 954 955 956
 
 enum CommandId {
   kOneBeforeStartPoint =
diff --git gpu/command_buffer/gles2_cmd_buffer_functions.txt gpu/command_buffer/gles2_cmd_buffer_functions.txt
957
index aa55852d05dd..4638d070c48c 100644
958 959
--- gpu/command_buffer/gles2_cmd_buffer_functions.txt
+++ gpu/command_buffer/gles2_cmd_buffer_functions.txt
960
@@ -417,6 +417,12 @@ GL_APICALL GLuint       GL_APIENTRY glCreateClientGpuFenceCHROMIUM (ClientGpuFen
961 962 963 964 965 966 967 968 969 970 971 972 973
 GL_APICALL void         GL_APIENTRY glWaitGpuFenceCHROMIUM (GLuint gpu_fence_id);
 GL_APICALL void         GL_APIENTRY glDestroyGpuFenceCHROMIUM (GLuint gpu_fence_id);
 
+// shared handle extensions
+GL_APICALL GLuint64     GL_APIENTRY glCreateSharedTexture (GLuint texture_id, GLsizei width, GLsizei height);
+GL_APICALL void         GL_APIENTRY glLockSharedTexture (GLuint64 shared_handle);
+GL_APICALL void         GL_APIENTRY glUnlockSharedTexture (GLuint64 shared_handle);
+GL_APICALL void         GL_APIENTRY glDeleteSharedTexture (GLuint64 shared_handle);
+
 // Extension CHROMIUM_nonblocking_readback
 GL_APICALL void         GL_APIENTRY glInvalidateReadbackBufferShadowDataCHROMIUM (GLidBuffer buffer_id);
 // (used for CHROMIUM_nonblocking_readback implementation)
diff --git gpu/command_buffer/service/BUILD.gn gpu/command_buffer/service/BUILD.gn
974
index 6955858281e7..045dee3185bf 100644
975 976
--- gpu/command_buffer/service/BUILD.gn
+++ gpu/command_buffer/service/BUILD.gn
977
@@ -107,6 +107,8 @@ target(link_target_type, "gles2_sources") {
978 979 980 981 982 983 984 985 986
   visibility = [ "//gpu/*" ]
 
   sources = [
+    "//cef/libcef/browser/gpu/external_texture_manager.cc",
+    "//cef/libcef/browser/gpu/external_texture_manager.h",
     "abstract_texture.h",
     "buffer_manager.cc",
     "buffer_manager.h",
diff --git gpu/command_buffer/service/gles2_cmd_decoder.cc gpu/command_buffer/service/gles2_cmd_decoder.cc
987
index 9f11a25c7ea9..67c119e2400e 100644
988 989
--- gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ gpu/command_buffer/service/gles2_cmd_decoder.cc
990
@@ -38,6 +38,7 @@
991 992 993 994 995 996 997
 #include "base/strings/stringprintf.h"
 #include "base/trace_event/trace_event.h"
 #include "build/build_config.h"
+#include "cef/libcef/browser/gpu/external_texture_manager.h"
 #include "gpu/command_buffer/common/debug_marker_manager.h"
 #include "gpu/command_buffer/common/gles2_cmd_format.h"
 #include "gpu/command_buffer/common/gles2_cmd_utils.h"
998
@@ -916,6 +917,13 @@ class GLES2DecoderImpl : public GLES2Decoder, public ErrorStateClient {
999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011
     return group_->mailbox_manager();
   }
 
+  ExternalTextureManager* external_texture_manager() {
+    if (!external_texture_manager_.get()) {
+      external_texture_manager_.reset(new gles2::ExternalTextureManager());
+    }
+    return external_texture_manager_.get();
+  }
+
   ImageManager* image_manager() { return group_->image_manager(); }
 
   VertexArrayManager* vertex_array_manager() {
1012
@@ -2643,6 +2651,8 @@ class GLES2DecoderImpl : public GLES2Decoder, public ErrorStateClient {
1013 1014 1015 1016 1017 1018 1019 1020
 
   std::unique_ptr<VertexArrayManager> vertex_array_manager_;
 
+  std::unique_ptr<ExternalTextureManager> external_texture_manager_;
+
   base::flat_set<scoped_refptr<Buffer>> writes_submitted_but_not_completed_;
 
   // The format of the back buffer_
1021
@@ -5618,6 +5628,59 @@ error::Error GLES2DecoderImpl::HandleDestroyGpuFenceCHROMIUM(
1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081
   return error::kNoError;
 }
 
+error::Error GLES2DecoderImpl::HandleCreateSharedTexture(
+    uint32_t immediate_data_size,
+    const volatile void* cmd_data) {
+  const volatile gles2::cmds::CreateSharedTexture& c =
+      *static_cast<const volatile gles2::cmds::CreateSharedTexture*>(cmd_data);
+  GLuint texture_id = c.texture_id;
+  uint32_t width = c.width;
+  uint32_t height = c.height;
+
+  typedef cmds::CreateSharedTexture::Result Result;
+  Result* result_dst = GetSharedMemoryAs<Result*>(
+      c.result_shm_id, c.result_shm_offset, sizeof(*result_dst));
+  if (!result_dst) {
+    return error::kOutOfBounds;
+  }
+
+  void* shared_handle = external_texture_manager()->CreateTexture(
+      texture_id, width, height, texture_manager());
+
+  *result_dst = (GLuint64)(shared_handle);
+  return error::kNoError;
+}
+
+error::Error GLES2DecoderImpl::HandleLockSharedTexture(
+    uint32_t immediate_data_size,
+    const volatile void* cmd_data) {
+  const volatile gles2::cmds::LockSharedTexture& c =
+      *static_cast<const volatile gles2::cmds::LockSharedTexture*>(cmd_data);
+  void* handle = (void*)(c.shared_handle());
+  external_texture_manager()->LockTexture(handle);
+  return error::kNoError;
+}
+
+error::Error GLES2DecoderImpl::HandleUnlockSharedTexture(
+    uint32_t immediate_data_size,
+    const volatile void* cmd_data) {
+  const volatile gles2::cmds::UnlockSharedTexture& c =
+      *static_cast<const volatile gles2::cmds::UnlockSharedTexture*>(cmd_data);
+  void* handle = (void*)(c.shared_handle());
+  external_texture_manager()->UnlockTexture(handle);
+  return error::kNoError;
+}
+
+error::Error GLES2DecoderImpl::HandleDeleteSharedTexture(
+    uint32_t immediate_data_size,
+    const volatile void* cmd_data) {
+  const volatile gles2::cmds::DeleteSharedTexture& c =
+      *static_cast<const volatile gles2::cmds::DeleteSharedTexture*>(cmd_data);
+  void* handle = (void*)(c.shared_handle());
+  external_texture_manager()->DeleteTexture(handle, texture_manager());
+  return error::kNoError;
+}
+
 void GLES2DecoderImpl::CreateBackTexture() {
   for (auto it = saved_back_textures_.begin(); it != saved_back_textures_.end();
        ++it) {
diff --git gpu/command_buffer/service/gles2_cmd_decoder_passthrough.cc gpu/command_buffer/service/gles2_cmd_decoder_passthrough.cc
1082
index 805d9ae94712..6723682670e4 100644
1083 1084
--- gpu/command_buffer/service/gles2_cmd_decoder_passthrough.cc
+++ gpu/command_buffer/service/gles2_cmd_decoder_passthrough.cc
1085
@@ -11,6 +11,7 @@
1086
 #include "base/callback.h"
1087
 #include "base/stl_util.h"
1088 1089 1090 1091 1092
 #include "base/strings/string_split.h"
+#include "cef/libcef/browser/gpu/external_texture_manager.h"
 #include "gpu/command_buffer/service/command_buffer_service.h"
 #include "gpu/command_buffer/service/decoder_client.h"
 #include "gpu/command_buffer/service/feature_info.h"
1093
@@ -2501,6 +2502,67 @@ error::Error GLES2DecoderPassthroughImpl::CheckSwapBuffersResult(
1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161
   return error::kNoError;
 }
 
+ExternalTextureManager*
+GLES2DecoderPassthroughImpl::external_texture_manager() {
+  if (!external_texture_manager_.get()) {
+    external_texture_manager_.reset(new gles2::ExternalTextureManager());
+  }
+  return external_texture_manager_.get();
+}
+
+error::Error GLES2DecoderPassthroughImpl::HandleCreateSharedTexture(
+    uint32_t immediate_data_size,
+    const volatile void* cmd_data) {
+  const volatile gles2::cmds::CreateSharedTexture& c =
+      *static_cast<const volatile gles2::cmds::CreateSharedTexture*>(cmd_data);
+  GLuint texture_id = c.texture_id;
+  uint32_t width = c.width;
+  uint32_t height = c.height;
+
+  typedef cmds::CreateSharedTexture::Result Result;
+  Result* result_dst = GetSharedMemoryAs<Result*>(
+      c.result_shm_id, c.result_shm_offset, sizeof(*result_dst));
+  if (!result_dst) {
+    return error::kOutOfBounds;
+  }
+
+  void* shared_handle = external_texture_manager()->CreateTexture(
+      texture_id, width, height, nullptr);
+
+  *result_dst = (GLuint64)(shared_handle);
+  return error::kNoError;
+}
+
+error::Error GLES2DecoderPassthroughImpl::HandleLockSharedTexture(
+    uint32_t immediate_data_size,
+    const volatile void* cmd_data) {
+  const volatile gles2::cmds::LockSharedTexture& c =
+      *static_cast<const volatile gles2::cmds::LockSharedTexture*>(cmd_data);
+  void* handle = (void*)(c.shared_handle());
+  external_texture_manager()->LockTexture(handle);
+  return error::kNoError;
+}
+
+error::Error GLES2DecoderPassthroughImpl::HandleUnlockSharedTexture(
+    uint32_t immediate_data_size,
+    const volatile void* cmd_data) {
+  const volatile gles2::cmds::UnlockSharedTexture& c =
+      *static_cast<const volatile gles2::cmds::UnlockSharedTexture*>(cmd_data);
+  void* handle = (void*)(c.shared_handle());
+  external_texture_manager()->UnlockTexture(handle);
+  return error::kNoError;
+}
+
+error::Error GLES2DecoderPassthroughImpl::HandleDeleteSharedTexture(
+    uint32_t immediate_data_size,
+    const volatile void* cmd_data) {
+  const volatile gles2::cmds::DeleteSharedTexture& c =
+      *static_cast<const volatile gles2::cmds::DeleteSharedTexture*>(cmd_data);
+  void* handle = (void*)(c.shared_handle());
+  external_texture_manager()->DeleteTexture(handle, nullptr);
+  return error::kNoError;
+}
+
 // static
 GLES2DecoderPassthroughImpl::TextureTarget
 GLES2DecoderPassthroughImpl::GLenumToTextureTarget(GLenum target) {
diff --git gpu/command_buffer/service/gles2_cmd_decoder_passthrough.h gpu/command_buffer/service/gles2_cmd_decoder_passthrough.h
1162
index ed682013976b..4bc28fe68a5d 100644
1163 1164
--- gpu/command_buffer/service/gles2_cmd_decoder_passthrough.h
+++ gpu/command_buffer/service/gles2_cmd_decoder_passthrough.h
1165
@@ -45,6 +45,7 @@ class SharedImageRepresentationGLTexturePassthrough;
1166 1167 1168 1169 1170
 namespace gles2 {
 
 class ContextGroup;
+class ExternalTextureManager;
 class GPUTracer;
1171
 class MultiDrawManager;
1172
 class PassthroughAbstractTextureImpl;
1173
@@ -377,6 +378,8 @@ class GPU_GLES2_EXPORT GLES2DecoderPassthroughImpl : public GLES2Decoder {
1174 1175 1176 1177 1178 1179 1180 1181
 
   void SetOptionalExtensionsRequestedForTesting(bool request_extensions);
 
+  ExternalTextureManager* external_texture_manager();
+
   void* GetScratchMemory(size_t size);
 
   template <typename T>
1182
@@ -580,6 +583,8 @@ class GPU_GLES2_EXPORT GLES2DecoderPassthroughImpl : public GLES2Decoder {
1183
 
1184
   std::unique_ptr<MultiDrawManager> multi_draw_manager_;
1185 1186 1187 1188 1189 1190 1191
 
+  std::unique_ptr<ExternalTextureManager> external_texture_manager_;
+
   // State tracking of currently bound 2D textures (client IDs)
   size_t active_texture_unit_;
 
diff --git ui/compositor/compositor.cc ui/compositor/compositor.cc
1192
index 311c26b6e0ea..8583fdfecc19 100644
1193 1194
--- ui/compositor/compositor.cc
+++ ui/compositor/compositor.cc
1195
@@ -555,6 +555,16 @@ scoped_refptr<CompositorVSyncManager> Compositor::vsync_manager() const {
1196
   return vsync_manager_;
1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212
 }
 
+void* Compositor::GetSharedTexture() {
+  if (context_factory_private_)
+    return context_factory_private_->GetSharedTexture(this);
+  return nullptr;
+}
+
+void Compositor::EnableSharedTexture(bool enable) {
+  shared_texture_enabled_ = enable;
+}
+
 void Compositor::AddObserver(CompositorObserver* observer) {
   observer_list_.AddObserver(observer);
 }
diff --git ui/compositor/compositor.h ui/compositor/compositor.h
1213
index 29784c677f4b..6e82af0d6aab 100644
1214 1215
--- ui/compositor/compositor.h
+++ ui/compositor/compositor.h
1216
@@ -25,6 +25,7 @@
1217
 #include "components/viz/common/surfaces/frame_sink_id.h"
1218
 #include "components/viz/common/surfaces/local_surface_id_allocation.h"
1219 1220 1221 1222 1223
 #include "components/viz/host/host_frame_sink_client.h"
+#include "components/viz/service/display/software_output_device.h"
 #include "third_party/skia/include/core/SkColor.h"
 #include "third_party/skia/include/core/SkMatrix44.h"
 #include "ui/compositor/compositor_animation_observer.h"
1224
@@ -158,6 +159,8 @@ class COMPOSITOR_EXPORT ContextFactoryPrivate {
1225 1226 1227 1228 1229 1230 1231 1232
                                        const viz::BeginFrameArgs& args) = 0;
 
   virtual void SetOutputIsSecure(Compositor* compositor, bool secure) = 0;
+
+  virtual void* GetSharedTexture(ui::Compositor* compositor) = 0;
 };
 
 // This class abstracts the creation of the 3D context for the compositor. It is
1233
@@ -193,6 +196,17 @@ class COMPOSITOR_EXPORT ContextFactory {
1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250
   virtual bool SyncTokensRequiredForDisplayCompositor() = 0;
 };
 
+class COMPOSITOR_EXPORT CompositorDelegate {
+ public:
+  virtual std::unique_ptr<viz::SoftwareOutputDevice> CreateSoftwareOutputDevice(
+      ui::Compositor* compositor) {
+    return nullptr;
+  }
+
+ protected:
+  virtual ~CompositorDelegate() {}
+};
+
 // Compositor object to take care of GPU painting.
 // A Browser compositor object is responsible for generating the final
 // displayable form of pixels comprising a single widget's contents. It draws an
1251
@@ -235,6 +249,9 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient,
1252 1253 1254 1255 1256 1257 1258 1259 1260
   // Schedules a redraw of the layer tree associated with this compositor.
   void ScheduleDraw();
 
+  CompositorDelegate* delegate() const { return delegate_; }
+  void SetDelegate(CompositorDelegate* delegate) { delegate_ = delegate; }
+
   // Sets the root of the layer tree drawn by this Compositor. The root layer
   // must have no parent. The compositor's root layer is reset if the root layer
   // is destroyed. NULL can be passed to reset the root layer, in which case the
1261
@@ -348,6 +365,10 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient,
1262 1263 1264 1265 1266 1267 1268 1269 1270 1271
     return task_runner_;
   }
 
+  void* GetSharedTexture();
+  void EnableSharedTexture(bool enable);
+  bool shared_texture_enabled() const { return shared_texture_enabled_; }
+
   // Compositor does not own observers. It is the responsibility of the
   // observer to remove itself when it is done observing.
   void AddObserver(CompositorObserver* observer);
1272
@@ -458,6 +479,8 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient,
1273 1274 1275 1276 1277 1278 1279 1280
   ui::ContextFactory* context_factory_;
   ui::ContextFactoryPrivate* context_factory_private_;
 
+  CompositorDelegate* delegate_ = nullptr;
+
   // The root of the Layer tree drawn by this compositor.
   Layer* root_layer_ = nullptr;
 
1281
@@ -492,6 +515,8 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient,
1282 1283
 
   ExternalBeginFrameClient* const external_begin_frame_client_;
1284 1285 1286 1287 1288 1289 1290
 
+  bool shared_texture_enabled_ = false;
+
   const bool force_software_compositor_;
 
   // The device scale factor of the monitor that this compositor is compositing
diff --git ui/compositor/host/host_context_factory_private.cc ui/compositor/host/host_context_factory_private.cc
1291
index 8297e1aabe3b..6acb9fa6cdfb 100644
1292 1293
--- ui/compositor/host/host_context_factory_private.cc
+++ ui/compositor/host/host_context_factory_private.cc
1294
@@ -255,6 +255,10 @@ void HostContextFactoryPrivate::SetOutputIsSecure(Compositor* compositor,
1295
     iter->second.display_private->SetOutputIsSecure(secure);
1296 1297 1298 1299 1300 1301 1302 1303 1304 1305
 }
 
+void* HostContextFactoryPrivate::GetSharedTexture(Compositor* /*compositor*/) {
+  return nullptr;
+}
+
 viz::FrameSinkManagerImpl* HostContextFactoryPrivate::GetFrameSinkManager() {
   // When running with viz there is no FrameSinkManagerImpl in the browser
   // process. FrameSinkManagerImpl runs in the GPU process instead. Anything in
diff --git ui/compositor/host/host_context_factory_private.h ui/compositor/host/host_context_factory_private.h
1306
index a74630258fd5..3a370c422e21 100644
1307 1308
--- ui/compositor/host/host_context_factory_private.h
+++ ui/compositor/host/host_context_factory_private.h
1309 1310 1311
@@ -50,6 +50,8 @@ class HostContextFactoryPrivate : public ContextFactoryPrivate {
 
   void UnconfigureCompositor(Compositor* compositor);
1312 1313 1314 1315 1316
 
+  void* GetSharedTexture(ui::Compositor* compositor) override;
+
   void set_is_gpu_compositing_disabled(bool value) {
     is_gpu_compositing_disabled_ = value;
1317
   }