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 @@ ...@@ -35,7 +35,6 @@
#endif #endif
#if defined(USE_OZONE) #if defined(USE_OZONE)
#include "ui/base/ui_base_features.h"
#include "ui/ozone/public/gpu_platform_support_host.h" #include "ui/ozone/public/gpu_platform_support_host.h"
#include "ui/ozone/public/ozone_platform.h" #include "ui/ozone/public/ozone_platform.h"
#endif #endif
...@@ -425,7 +424,7 @@ void GpuHostImpl::DidInitialize( ...@@ -425,7 +424,7 @@ void GpuHostImpl::DidInitialize(
gpu_feature_info_for_hardware_gpu, gpu_extra_info); gpu_feature_info_for_hardware_gpu, gpu_extra_info);
if (!params_.disable_gpu_shader_disk_cache) { if (!params_.disable_gpu_shader_disk_cache) {
CreateChannelCache(gpu::kInProcessCommandBufferClientId); CreateChannelCache(gpu::kDisplayCompositorClientId);
bool use_gr_shader_cache = base::FeatureList::IsEnabled( bool use_gr_shader_cache = base::FeatureList::IsEnabled(
features::kDefaultEnableOopRasterization) || features::kDefaultEnableOopRasterization) ||
......
...@@ -35,7 +35,7 @@ void DestroyOnThread(scoped_refptr<base::SingleThreadTaskRunner> task_runner, ...@@ -35,7 +35,7 @@ void DestroyOnThread(scoped_refptr<base::SingleThreadTaskRunner> task_runner,
InProcessGpuMemoryBufferManager::InProcessGpuMemoryBufferManager( InProcessGpuMemoryBufferManager::InProcessGpuMemoryBufferManager(
gpu::GpuMemoryBufferFactory* gpu_memory_buffer_factory, gpu::GpuMemoryBufferFactory* gpu_memory_buffer_factory,
gpu::SyncPointManager* sync_point_manager) gpu::SyncPointManager* sync_point_manager)
: client_id_(gpu::kInProcessCommandBufferClientId), : client_id_(gpu::kDisplayCompositorClientId),
gpu_memory_buffer_factory_(gpu_memory_buffer_factory), gpu_memory_buffer_factory_(gpu_memory_buffer_factory),
sync_point_manager_(sync_point_manager), sync_point_manager_(sync_point_manager),
task_runner_(base::ThreadTaskRunnerHandle::Get()) { task_runner_(base::ThreadTaskRunnerHandle::Get()) {
......
...@@ -337,10 +337,9 @@ OutputPresenterFuchsia::AllocateImages(gfx::ColorSpace color_space, ...@@ -337,10 +337,9 @@ OutputPresenterFuchsia::AllocateImages(gfx::ColorSpace color_space,
auto mailbox = gpu::Mailbox::GenerateForSharedImage(); auto mailbox = gpu::Mailbox::GenerateForSharedImage();
if (!shared_image_factory_.CreateSharedImage( if (!shared_image_factory_.CreateSharedImage(
mailbox, gpu::kInProcessCommandBufferClientId, mailbox, gpu::kDisplayCompositorClientId, std::move(gmb_handle),
std::move(gmb_handle), buffer_format_, gpu::kNullSurfaceHandle, buffer_format_, gpu::kNullSurfaceHandle, frame_size_, color_space,
frame_size_, color_space, kTopLeft_GrSurfaceOrigin, kTopLeft_GrSurfaceOrigin, kPremul_SkAlphaType, image_usage)) {
kPremul_SkAlphaType, image_usage)) {
return {}; return {};
} }
......
...@@ -492,7 +492,7 @@ bool SkiaOutputSurfaceImplOnGpu::FinishPaintCurrentFrame( ...@@ -492,7 +492,7 @@ bool SkiaOutputSurfaceImplOnGpu::FinishPaintCurrentFrame(
base::Optional<gpu::raster::GrShaderCache::ScopedCacheUse> cache_use; base::Optional<gpu::raster::GrShaderCache::ScopedCacheUse> cache_use;
if (dependency_->GetGrShaderCache()) { if (dependency_->GetGrShaderCache()) {
cache_use.emplace(dependency_->GetGrShaderCache(), cache_use.emplace(dependency_->GetGrShaderCache(),
gpu::kInProcessCommandBufferClientId); gpu::kDisplayCompositorClientId);
} }
std::vector<GrBackendSemaphore> begin_semaphores; std::vector<GrBackendSemaphore> begin_semaphores;
...@@ -619,7 +619,7 @@ void SkiaOutputSurfaceImplOnGpu::FinishPaintRenderPass( ...@@ -619,7 +619,7 @@ void SkiaOutputSurfaceImplOnGpu::FinishPaintRenderPass(
base::Optional<gpu::raster::GrShaderCache::ScopedCacheUse> cache_use; base::Optional<gpu::raster::GrShaderCache::ScopedCacheUse> cache_use;
if (dependency_->GetGrShaderCache()) { if (dependency_->GetGrShaderCache()) {
cache_use.emplace(dependency_->GetGrShaderCache(), cache_use.emplace(dependency_->GetGrShaderCache(),
gpu::kInProcessCommandBufferClientId); gpu::kDisplayCompositorClientId);
} }
std::vector<GrBackendSemaphore> begin_semaphores; std::vector<GrBackendSemaphore> begin_semaphores;
std::vector<GrBackendSemaphore> end_semaphores; std::vector<GrBackendSemaphore> end_semaphores;
...@@ -716,7 +716,7 @@ bool SkiaOutputSurfaceImplOnGpu::CopyOutput( ...@@ -716,7 +716,7 @@ bool SkiaOutputSurfaceImplOnGpu::CopyOutput(
base::Optional<gpu::raster::GrShaderCache::ScopedCacheUse> cache_use; base::Optional<gpu::raster::GrShaderCache::ScopedCacheUse> cache_use;
if (dependency_->GetGrShaderCache()) { if (dependency_->GetGrShaderCache()) {
cache_use.emplace(dependency_->GetGrShaderCache(), cache_use.emplace(dependency_->GetGrShaderCache(),
gpu::kInProcessCommandBufferClientId); gpu::kDisplayCompositorClientId);
} }
SkPaint paint; SkPaint paint;
paint.setColor(SK_ColorBLACK); paint.setColor(SK_ColorBLACK);
...@@ -728,7 +728,7 @@ bool SkiaOutputSurfaceImplOnGpu::CopyOutput( ...@@ -728,7 +728,7 @@ bool SkiaOutputSurfaceImplOnGpu::CopyOutput(
base::Optional<gpu::raster::GrShaderCache::ScopedCacheUse> cache_use; base::Optional<gpu::raster::GrShaderCache::ScopedCacheUse> cache_use;
if (dependency_->GetGrShaderCache()) { if (dependency_->GetGrShaderCache()) {
cache_use.emplace(dependency_->GetGrShaderCache(), cache_use.emplace(dependency_->GetGrShaderCache(),
gpu::kInProcessCommandBufferClientId); gpu::kDisplayCompositorClientId);
} }
// For downscaling, use the GOOD quality setting (appropriate for // For downscaling, use the GOOD quality setting (appropriate for
......
...@@ -461,7 +461,7 @@ void BrowserGpuChannelHostFactory::InitializeShaderDiskCacheOnIO( ...@@ -461,7 +461,7 @@ void BrowserGpuChannelHostFactory::InitializeShaderDiskCacheOnIO(
const base::FilePath& cache_dir) { const base::FilePath& cache_dir) {
GetShaderCacheFactorySingleton()->SetCacheInfo(gpu_client_id, cache_dir); GetShaderCacheFactorySingleton()->SetCacheInfo(gpu_client_id, cache_dir);
GetShaderCacheFactorySingleton()->SetCacheInfo( GetShaderCacheFactorySingleton()->SetCacheInfo(
gpu::kInProcessCommandBufferClientId, cache_dir); gpu::kDisplayCompositorClientId, cache_dir);
} }
// static // static
......
...@@ -527,11 +527,11 @@ int32_t GLManager::CreateImage(ClientBuffer buffer, ...@@ -527,11 +527,11 @@ int32_t GLManager::CreateImage(ClientBuffer buffer,
if (gpu_memory_buffer->GetType() == gfx::NATIVE_PIXMAP) { if (gpu_memory_buffer->GetType() == gfx::NATIVE_PIXMAP) {
gfx::GpuMemoryBufferHandle handle = gpu_memory_buffer->CloneHandle(); gfx::GpuMemoryBufferHandle handle = gpu_memory_buffer->CloneHandle();
gfx::BufferFormat format = gpu_memory_buffer->GetFormat(); gfx::BufferFormat format = gpu_memory_buffer->GetFormat();
gl_image = gpu_memory_buffer_factory_->AsImageFactory() gl_image =
->CreateImageForGpuMemoryBuffer( gpu_memory_buffer_factory_->AsImageFactory()
std::move(handle), size, format, ->CreateImageForGpuMemoryBuffer(std::move(handle), size, format,
gpu::kInProcessCommandBufferClientId, gpu::kDisplayCompositorClientId,
gpu::kNullSurfaceHandle); gpu::kNullSurfaceHandle);
if (!gl_image) if (!gl_image)
return -1; return -1;
} }
......
...@@ -12,9 +12,8 @@ namespace gpu { ...@@ -12,9 +12,8 @@ namespace gpu {
// special constants are used for particular clients that should always be // special constants are used for particular clients that should always be
// assigned the same ID. // assigned the same ID.
// The ID used by the InProcessCommandBuffer created in the GPU process for viz // The ID used by the display compositor running in the GPU process.
// display compositor. constexpr int32_t kDisplayCompositorClientId = -1;
constexpr int32_t kInProcessCommandBufferClientId = -1;
// The ID used for storing shaders created by skia in the GPU process. Note that // 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 // 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; ...@@ -100,7 +100,7 @@ base::AtomicSequenceNumber g_next_route_id;
base::AtomicSequenceNumber g_next_image_id; base::AtomicSequenceNumber g_next_image_id;
CommandBufferId NextCommandBufferId() { CommandBufferId NextCommandBufferId() {
return CommandBufferIdFromChannelAndRoute(kInProcessCommandBufferClientId, return CommandBufferIdFromChannelAndRoute(kDisplayCompositorClientId,
g_next_route_id.GetNext() + 1); g_next_route_id.GetNext() + 1);
} }
...@@ -881,7 +881,7 @@ void InProcessCommandBuffer::FlushOnGpuThread( ...@@ -881,7 +881,7 @@ void InProcessCommandBuffer::FlushOnGpuThread(
{ {
base::Optional<raster::GrShaderCache::ScopedCacheUse> gr_cache_use; base::Optional<raster::GrShaderCache::ScopedCacheUse> gr_cache_use;
if (gr_shader_cache_) 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()); command_buffer_->Flush(put_offset, decoder_.get());
} }
// Update state before signaling the flush event. // Update state before signaling the flush event.
...@@ -1140,7 +1140,7 @@ void InProcessCommandBuffer::CreateImageOnGpuThread( ...@@ -1140,7 +1140,7 @@ void InProcessCommandBuffer::CreateImageOnGpuThread(
scoped_refptr<gl::GLImage> image = scoped_refptr<gl::GLImage> image =
image_factory_->CreateImageForGpuMemoryBuffer( image_factory_->CreateImageForGpuMemoryBuffer(
std::move(handle), size, format, kInProcessCommandBufferClientId, std::move(handle), size, format, kDisplayCompositorClientId,
kNullSurfaceHandle); kNullSurfaceHandle);
if (!image.get()) { if (!image.get()) {
LOG(ERROR) << "Failed to create image for buffer."; LOG(ERROR) << "Failed to create image for buffer.";
...@@ -1183,8 +1183,8 @@ void InProcessCommandBuffer::CacheShader(const std::string& key, ...@@ -1183,8 +1183,8 @@ void InProcessCommandBuffer::CacheShader(const std::string& key,
const std::string& shader) { const std::string& shader) {
DCHECK_CALLED_ON_VALID_SEQUENCE(gpu_sequence_checker_); DCHECK_CALLED_ON_VALID_SEQUENCE(gpu_sequence_checker_);
if (gpu_channel_manager_delegate_) if (gpu_channel_manager_delegate_)
gpu_channel_manager_delegate_->StoreShaderToDisk( gpu_channel_manager_delegate_->StoreShaderToDisk(kDisplayCompositorClientId,
kInProcessCommandBufferClientId, key, shader); key, shader);
} }
void InProcessCommandBuffer::OnFenceSyncRelease(uint64_t release) { void InProcessCommandBuffer::OnFenceSyncRelease(uint64_t release) {
......
...@@ -317,8 +317,7 @@ GpuChannelManager::GpuChannelManager( ...@@ -317,8 +317,7 @@ GpuChannelManager::GpuChannelManager(
if (enable_gr_shader_cache && !disable_disk_cache) { if (enable_gr_shader_cache && !disable_disk_cache) {
gr_shader_cache_.emplace(gpu_preferences.gpu_program_cache_size, this); gr_shader_cache_.emplace(gpu_preferences.gpu_program_cache_size, this);
if (using_skia_renderer) { if (using_skia_renderer) {
gr_shader_cache_->CacheClientIdOnDisk( gr_shader_cache_->CacheClientIdOnDisk(gpu::kDisplayCompositorClientId);
gpu::kInProcessCommandBufferClientId);
} }
} }
} }
......
...@@ -296,7 +296,7 @@ void SharedImageInterfaceInProcess::CreateGMBSharedImageOnGpuThread( ...@@ -296,7 +296,7 @@ void SharedImageInterfaceInProcess::CreateGMBSharedImageOnGpuThread(
// TODO(piman): add support for SurfaceHandle (for backbuffers for ozone/drm). // TODO(piman): add support for SurfaceHandle (for backbuffers for ozone/drm).
SurfaceHandle surface_handle = kNullSurfaceHandle; SurfaceHandle surface_handle = kNullSurfaceHandle;
if (!shared_image_factory_->CreateSharedImage( 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, surface_handle, size, color_space, surface_origin, alpha_type,
usage)) { usage)) {
// Signal errors by losing the command buffer. // 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