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

android_webview / gpu / aw_content_gpu_client.cc [blame]

// Copyright 2016 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "android_webview/gpu/aw_content_gpu_client.h"

#include <utility>

namespace android_webview {

AwContentGpuClient::AwContentGpuClient(
    GetSyncPointManagerCallback sync_point_manager_callback,
    GetSharedImageManagerCallback shared_image_manager_callback,
    GetSchedulerCallback scheduler_callback,
    GetVizCompositorThreadRunnerCallback viz_compositor_thread_runner_callback,
    const AwGrContextOptionsProvider* gr_context_options_provider)
    : sync_point_manager_callback_(std::move(sync_point_manager_callback)),
      shared_image_manager_callback_(std::move(shared_image_manager_callback)),
      scheduler_callback_(std::move(scheduler_callback)),
      viz_compositor_thread_runner_callback_(
          std::move(viz_compositor_thread_runner_callback)),
      gr_context_options_provider_(gr_context_options_provider) {}

AwContentGpuClient::~AwContentGpuClient() {}

gpu::SyncPointManager* AwContentGpuClient::GetSyncPointManager() {
  return sync_point_manager_callback_.Run();
}

gpu::SharedImageManager* AwContentGpuClient::GetSharedImageManager() {
  return shared_image_manager_callback_.Run();
}

gpu::Scheduler* AwContentGpuClient::GetScheduler() {
  return scheduler_callback_.Run();
}

viz::VizCompositorThreadRunner*
AwContentGpuClient::GetVizCompositorThreadRunner() {
  return viz_compositor_thread_runner_callback_.Run();
}

const gpu::SharedContextState::GrContextOptionsProvider*
AwContentGpuClient::GetGrContextOptionsProvider() {
  return gr_context_options_provider_;
}

}  // namespace android_webview