Commit 90f620c2 authored by kylechar's avatar kylechar Committed by Commit Bot

Rename display compositor client id constant

Change kInProcessCommandBufferClientId to kDisplayCompositorClientId.
InProcessCommandBuffer is no longer used for the display compositor with
SkiaRenderer so the constant name is inaccurate.

Bug: 1114763
Change-Id: I03b9680930c61e1cb922d97c76959eb06e689638
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2352761Reviewed-by: default avatarKen Buchanan <kenrb@chromium.org>
Reviewed-by: default avatarJonathan Backer <backer@chromium.org>
Commit-Queue: kylechar <kylechar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#799159}
parent 53640169
......@@ -35,7 +35,6 @@
#endif
#if defined(USE_OZONE)
#include "ui/base/ui_base_features.h"
#include "ui/ozone/public/gpu_platform_support_host.h"
#include "ui/ozone/public/ozone_platform.h"
#endif
......@@ -425,7 +424,7 @@ void GpuHostImpl::DidInitialize(
gpu_feature_info_for_hardware_gpu, gpu_extra_info);
if (!params_.disable_gpu_shader_disk_cache) {
CreateChannelCache(gpu::kInProcessCommandBufferClientId);
CreateChannelCache(gpu::kDisplayCompositorClientId);
bool use_gr_shader_cache = base::FeatureList::IsEnabled(
features::kDefaultEnableOopRasterization) ||
......
......@@ -35,7 +35,7 @@ void DestroyOnThread(scoped_refptr<base::SingleThreadTaskRunner> task_runner,
InProcessGpuMemoryBufferManager::InProcessGpuMemoryBufferManager(
gpu::GpuMemoryBufferFactory* gpu_memory_buffer_factory,
gpu::SyncPointManager* sync_point_manager)
: client_id_(gpu::kInProcessCommandBufferClientId),
: client_id_(gpu::kDisplayCompositorClientId),
gpu_memory_buffer_factory_(gpu_memory_buffer_factory),
sync_point_manager_(sync_point_manager),
task_runner_(base::ThreadTaskRunnerHandle::Get()) {
......
......@@ -337,10 +337,9 @@ OutputPresenterFuchsia::AllocateImages(gfx::ColorSpace color_space,
auto mailbox = gpu::Mailbox::GenerateForSharedImage();
if (!shared_image_factory_.CreateSharedImage(
mailbox, gpu::kInProcessCommandBufferClientId,
std::move(gmb_handle), buffer_format_, gpu::kNullSurfaceHandle,
frame_size_, color_space, kTopLeft_GrSurfaceOrigin,
kPremul_SkAlphaType, image_usage)) {
mailbox, gpu::kDisplayCompositorClientId, std::move(gmb_handle),
buffer_format_, gpu::kNullSurfaceHandle, frame_size_, color_space,
kTopLeft_GrSurfaceOrigin, kPremul_SkAlphaType, image_usage)) {
return {};
}
......
......@@ -492,7 +492,7 @@ bool SkiaOutputSurfaceImplOnGpu::FinishPaintCurrentFrame(
base::Optional<gpu::raster::GrShaderCache::ScopedCacheUse> cache_use;
if (dependency_->GetGrShaderCache()) {
cache_use.emplace(dependency_->GetGrShaderCache(),
gpu::kInProcessCommandBufferClientId);
gpu::kDisplayCompositorClientId);
}
std::vector<GrBackendSemaphore> begin_semaphores;
......@@ -619,7 +619,7 @@ void SkiaOutputSurfaceImplOnGpu::FinishPaintRenderPass(
base::Optional<gpu::raster::GrShaderCache::ScopedCacheUse> cache_use;
if (dependency_->GetGrShaderCache()) {
cache_use.emplace(dependency_->GetGrShaderCache(),
gpu::kInProcessCommandBufferClientId);
gpu::kDisplayCompositorClientId);
}
std::vector<GrBackendSemaphore> begin_semaphores;
std::vector<GrBackendSemaphore> end_semaphores;
......@@ -716,7 +716,7 @@ bool SkiaOutputSurfaceImplOnGpu::CopyOutput(
base::Optional<gpu::raster::GrShaderCache::ScopedCacheUse> cache_use;
if (dependency_->GetGrShaderCache()) {
cache_use.emplace(dependency_->GetGrShaderCache(),
gpu::kInProcessCommandBufferClientId);
gpu::kDisplayCompositorClientId);
}
SkPaint paint;
paint.setColor(SK_ColorBLACK);
......@@ -728,7 +728,7 @@ bool SkiaOutputSurfaceImplOnGpu::CopyOutput(
base::Optional<gpu::raster::GrShaderCache::ScopedCacheUse> cache_use;
if (dependency_->GetGrShaderCache()) {
cache_use.emplace(dependency_->GetGrShaderCache(),
gpu::kInProcessCommandBufferClientId);
gpu::kDisplayCompositorClientId);
}
// For downscaling, use the GOOD quality setting (appropriate for
......
......@@ -461,7 +461,7 @@ void BrowserGpuChannelHostFactory::InitializeShaderDiskCacheOnIO(
const base::FilePath& cache_dir) {
GetShaderCacheFactorySingleton()->SetCacheInfo(gpu_client_id, cache_dir);
GetShaderCacheFactorySingleton()->SetCacheInfo(
gpu::kInProcessCommandBufferClientId, cache_dir);
gpu::kDisplayCompositorClientId, cache_dir);
}
// static
......
......@@ -527,11 +527,11 @@ int32_t GLManager::CreateImage(ClientBuffer buffer,
if (gpu_memory_buffer->GetType() == gfx::NATIVE_PIXMAP) {
gfx::GpuMemoryBufferHandle handle = gpu_memory_buffer->CloneHandle();
gfx::BufferFormat format = gpu_memory_buffer->GetFormat();
gl_image = gpu_memory_buffer_factory_->AsImageFactory()
->CreateImageForGpuMemoryBuffer(
std::move(handle), size, format,
gpu::kInProcessCommandBufferClientId,
gpu::kNullSurfaceHandle);
gl_image =
gpu_memory_buffer_factory_->AsImageFactory()
->CreateImageForGpuMemoryBuffer(std::move(handle), size, format,
gpu::kDisplayCompositorClientId,
gpu::kNullSurfaceHandle);
if (!gl_image)
return -1;
}
......
......@@ -12,9 +12,8 @@ namespace gpu {
// special constants are used for particular clients that should always be
// assigned the same ID.
// The ID used by the InProcessCommandBuffer created in the GPU process for viz
// display compositor.
constexpr int32_t kInProcessCommandBufferClientId = -1;
// The ID used by the display compositor running in the GPU process.
constexpr int32_t kDisplayCompositorClientId = -1;
// The ID used for storing shaders created by skia in the GPU process. Note that
// this ID doesn't correspond to a real Gpu client/channel, but is required so
......
......@@ -100,7 +100,7 @@ base::AtomicSequenceNumber g_next_route_id;
base::AtomicSequenceNumber g_next_image_id;
CommandBufferId NextCommandBufferId() {
return CommandBufferIdFromChannelAndRoute(kInProcessCommandBufferClientId,
return CommandBufferIdFromChannelAndRoute(kDisplayCompositorClientId,
g_next_route_id.GetNext() + 1);
}
......@@ -881,7 +881,7 @@ void InProcessCommandBuffer::FlushOnGpuThread(
{
base::Optional<raster::GrShaderCache::ScopedCacheUse> gr_cache_use;
if (gr_shader_cache_)
gr_cache_use.emplace(gr_shader_cache_, kInProcessCommandBufferClientId);
gr_cache_use.emplace(gr_shader_cache_, kDisplayCompositorClientId);
command_buffer_->Flush(put_offset, decoder_.get());
}
// Update state before signaling the flush event.
......@@ -1140,7 +1140,7 @@ void InProcessCommandBuffer::CreateImageOnGpuThread(
scoped_refptr<gl::GLImage> image =
image_factory_->CreateImageForGpuMemoryBuffer(
std::move(handle), size, format, kInProcessCommandBufferClientId,
std::move(handle), size, format, kDisplayCompositorClientId,
kNullSurfaceHandle);
if (!image.get()) {
LOG(ERROR) << "Failed to create image for buffer.";
......@@ -1183,8 +1183,8 @@ void InProcessCommandBuffer::CacheShader(const std::string& key,
const std::string& shader) {
DCHECK_CALLED_ON_VALID_SEQUENCE(gpu_sequence_checker_);
if (gpu_channel_manager_delegate_)
gpu_channel_manager_delegate_->StoreShaderToDisk(
kInProcessCommandBufferClientId, key, shader);
gpu_channel_manager_delegate_->StoreShaderToDisk(kDisplayCompositorClientId,
key, shader);
}
void InProcessCommandBuffer::OnFenceSyncRelease(uint64_t release) {
......
......@@ -317,8 +317,7 @@ GpuChannelManager::GpuChannelManager(
if (enable_gr_shader_cache && !disable_disk_cache) {
gr_shader_cache_.emplace(gpu_preferences.gpu_program_cache_size, this);
if (using_skia_renderer) {
gr_shader_cache_->CacheClientIdOnDisk(
gpu::kInProcessCommandBufferClientId);
gr_shader_cache_->CacheClientIdOnDisk(gpu::kDisplayCompositorClientId);
}
}
}
......
......@@ -296,7 +296,7 @@ void SharedImageInterfaceInProcess::CreateGMBSharedImageOnGpuThread(
// TODO(piman): add support for SurfaceHandle (for backbuffers for ozone/drm).
SurfaceHandle surface_handle = kNullSurfaceHandle;
if (!shared_image_factory_->CreateSharedImage(
mailbox, kInProcessCommandBufferClientId, std::move(handle), format,
mailbox, kDisplayCompositorClientId, std::move(handle), format,
surface_handle, size, color_space, surface_origin, alpha_type,
usage)) {
// Signal errors by losing the command buffer.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment