0

[//cc] Remove CrossThreadSharedBitmap

This is now dead code.

Bug: 40064122
Change-Id: I01f8b8485cd4a033de7d6aaa712b9ebe4f7d3e07
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6172431
Reviewed-by: Vasiliy Telezhnikov <vasilyt@chromium.org>
Commit-Queue: Colin Blundell <blundell@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1407271}
This commit is contained in:
Colin Blundell
2025-01-16 06:13:35 -08:00
committed by Chromium LUCI CQ
parent 8129f7fad2
commit 94bb02f7cc
5 changed files with 0 additions and 91 deletions

@ -263,8 +263,6 @@ cc_component("cc") {
"raster/tile_task.h",
"raster/zero_copy_raster_buffer_provider.cc",
"raster/zero_copy_raster_buffer_provider.h",
"resources/cross_thread_shared_bitmap.cc",
"resources/cross_thread_shared_bitmap.h",
"resources/memory_history.cc",
"resources/memory_history.h",
"resources/resource_pool.cc",

@ -18,7 +18,6 @@
#include "base/threading/thread_checker.h"
#include "cc/cc_export.h"
#include "cc/layers/layer.h"
#include "cc/resources/cross_thread_shared_bitmap.h"
#include "components/viz/common/resources/release_callback.h"
#include "components/viz/common/resources/transferable_resource.h"
#include "ui/gfx/hdr_metadata.h"

@ -15,7 +15,6 @@
#include "base/memory/ptr_util.h"
#include "cc/cc_export.h"
#include "cc/layers/layer_impl.h"
#include "cc/resources/cross_thread_shared_bitmap.h"
#include "components/viz/common/resources/release_callback.h"
#include "components/viz/common/resources/transferable_resource.h"
#include "ui/gfx/hdr_metadata.h"

@ -1,25 +0,0 @@
// Copyright 2018 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "cc/resources/cross_thread_shared_bitmap.h"
#include <utility>
namespace cc {
CrossThreadSharedBitmap::CrossThreadSharedBitmap(
const viz::SharedBitmapId& id,
base::ReadOnlySharedMemoryRegion region,
base::WritableSharedMemoryMapping mapping,
const gfx::Size& size,
viz::SharedImageFormat format)
: id_(id),
region_(std::move(region)),
mapping_(std::move(mapping)),
size_(size),
format_(format) {}
CrossThreadSharedBitmap::~CrossThreadSharedBitmap() = default;
} // namespace cc

@ -1,62 +0,0 @@
// Copyright 2018 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CC_RESOURCES_CROSS_THREAD_SHARED_BITMAP_H_
#define CC_RESOURCES_CROSS_THREAD_SHARED_BITMAP_H_
#include <utility>
#include "base/memory/read_only_shared_memory_region.h"
#include "base/memory/ref_counted.h"
#include "base/memory/shared_memory_mapping.h"
#include "cc/cc_export.h"
#include "components/viz/common/resources/shared_bitmap.h"
#include "components/viz/common/resources/shared_image_format.h"
#include "ui/gfx/geometry/size.h"
namespace cc {
// This class holds ownership of a base::ReadOnlySharedMemoryRegion and its
// base::WritableSharedMemoryMapping for use as a composited resource, and is
// refcounted in order to share ownership with the LayerTreeHost, via
// TextureLayer, which needs access to the base::ReadOnlySharedMemory from
// the compositor thread. Because all the fields exposed are const, they can
// be used from any thread without conflict, as they only read existing states.
class CC_EXPORT CrossThreadSharedBitmap
: public base::RefCountedThreadSafe<CrossThreadSharedBitmap> {
public:
CrossThreadSharedBitmap(const viz::SharedBitmapId& id,
const base::ReadOnlySharedMemoryRegion region,
base::WritableSharedMemoryMapping mapping,
const gfx::Size& size,
viz::SharedImageFormat format);
const viz::SharedBitmapId& id() const { return id_; }
const base::ReadOnlySharedMemoryRegion& shared_region() const {
return region_;
}
void* memory() { return const_cast<void*>(std::as_const(*this).memory()); }
const void* memory() const {
// TODO(crbug.com/355003196): This returns an unsafe unbounded pointer. The
// return type here should be changed to a span, then return span(mapping_).
return mapping_.data();
}
const gfx::Size& size() const { return size_; }
viz::SharedImageFormat format() const { return format_; }
private:
friend base::RefCountedThreadSafe<CrossThreadSharedBitmap>;
~CrossThreadSharedBitmap();
const viz::SharedBitmapId id_;
const base::ReadOnlySharedMemoryRegion region_;
base::WritableSharedMemoryMapping mapping_;
const gfx::Size size_;
const viz::SharedImageFormat format_;
};
} // namespace cc
#endif // CC_RESOURCES_CROSS_THREAD_SHARED_BITMAP_H_