Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Impeller] Remove use of FML_DISALLOW_<FOO> macros in Impeller. #47307

Merged
merged 1 commit into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion impeller/aiks/aiks_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ class AiksContext {
std::unique_ptr<ContentContext> content_context_;
bool is_valid_ = false;

FML_DISALLOW_COPY_AND_ASSIGN(AiksContext);
AiksContext(const AiksContext&) = delete;

AiksContext& operator=(const AiksContext&) = delete;
};

} // namespace impeller
4 changes: 3 additions & 1 deletion impeller/aiks/aiks_playground.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ class AiksPlayground : public PlaygroundTest {
std::shared_ptr<TypographerContext> typographer_context_;
AiksInspector inspector_;

FML_DISALLOW_COPY_AND_ASSIGN(AiksPlayground);
AiksPlayground(const AiksPlayground&) = delete;

AiksPlayground& operator=(const AiksPlayground&) = delete;
};

} // namespace impeller
4 changes: 3 additions & 1 deletion impeller/aiks/aiks_playground_inspector.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ class AiksInspector {
CaptureElement* selected_element_ = nullptr;
std::optional<Picture> last_picture_;

FML_DISALLOW_COPY_AND_ASSIGN(AiksInspector);
AiksInspector(const AiksInspector&) = delete;

AiksInspector& operator=(const AiksInspector&) = delete;
};

}; // namespace impeller
4 changes: 3 additions & 1 deletion impeller/aiks/canvas.h
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,9 @@ class Canvas {
Scalar corner_radius,
const Paint& paint);

FML_DISALLOW_COPY_AND_ASSIGN(Canvas);
Canvas(const Canvas&) = delete;

Canvas& operator=(const Canvas&) = delete;
};

} // namespace impeller
4 changes: 3 additions & 1 deletion impeller/aiks/image.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ class Image {
private:
const std::shared_ptr<Texture> texture_;

FML_DISALLOW_COPY_AND_ASSIGN(Image);
Image(const Image&) = delete;

Image& operator=(const Image&) = delete;
};

} // namespace impeller
9 changes: 7 additions & 2 deletions impeller/aiks/paint_pass_delegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ class PaintPassDelegate final : public EntityPassDelegate {
private:
const Paint paint_;

FML_DISALLOW_COPY_AND_ASSIGN(PaintPassDelegate);
PaintPassDelegate(const PaintPassDelegate&) = delete;

PaintPassDelegate& operator=(const PaintPassDelegate&) = delete;
};

/// A delegate that attempts to forward opacity from a save layer to
Expand Down Expand Up @@ -74,7 +76,10 @@ class OpacityPeepholePassDelegate final : public EntityPassDelegate {
private:
const Paint paint_;

FML_DISALLOW_COPY_AND_ASSIGN(OpacityPeepholePassDelegate);
OpacityPeepholePassDelegate(const OpacityPeepholePassDelegate&) = delete;

OpacityPeepholePassDelegate& operator=(const OpacityPeepholePassDelegate&) =
delete;
};

} // namespace impeller
4 changes: 3 additions & 1 deletion impeller/archivist/archive.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ class Archive {
const UnarchiveStep& stepper,
PrimaryKey primary_key = std::nullopt);

FML_DISALLOW_COPY_AND_ASSIGN(Archive);
Archive(const Archive&) = delete;

Archive& operator=(const Archive&) = delete;
};

} // namespace impeller
4 changes: 3 additions & 1 deletion impeller/archivist/archive_class_registration.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ class ArchiveClassRegistration {
MemberColumnMap column_map_;
bool is_valid_ = false;

FML_DISALLOW_COPY_AND_ASSIGN(ArchiveClassRegistration);
ArchiveClassRegistration(const ArchiveClassRegistration&) = delete;

ArchiveClassRegistration& operator=(const ArchiveClassRegistration&) = delete;
};

} // namespace impeller
4 changes: 3 additions & 1 deletion impeller/archivist/archive_database.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ struct ArchiveDatabase::Handle {
private:
::sqlite3* handle_ = nullptr;

FML_DISALLOW_COPY_AND_ASSIGN(Handle);
Handle(const Handle&) = delete;

Handle& operator=(const Handle&) = delete;
};

ArchiveDatabase::ArchiveDatabase(const std::string& filename)
Expand Down
4 changes: 3 additions & 1 deletion impeller/archivist/archive_database.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ class ArchiveDatabase {

ArchiveStatement CreateStatement(const std::string& statementString) const;

FML_DISALLOW_COPY_AND_ASSIGN(ArchiveDatabase);
ArchiveDatabase(const ArchiveDatabase&) = delete;

ArchiveDatabase& operator=(const ArchiveDatabase&) = delete;
};

} // namespace impeller
4 changes: 3 additions & 1 deletion impeller/archivist/archive_location.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,9 @@ class ArchiveLocation {
const ArchiveDef& otherDef,
Archivable& other);

FML_DISALLOW_COPY_AND_ASSIGN(ArchiveLocation);
ArchiveLocation(const ArchiveLocation&) = delete;

ArchiveLocation& operator=(const ArchiveLocation&) = delete;
};

} // namespace impeller
4 changes: 3 additions & 1 deletion impeller/archivist/archive_statement.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ struct ArchiveStatement::Handle {
private:
::sqlite3_stmt* handle_ = nullptr;

FML_DISALLOW_COPY_AND_ASSIGN(Handle);
Handle(const Handle&) = delete;

Handle& operator=(const Handle&) = delete;
};

ArchiveStatement::ArchiveStatement(void* db, const std::string& statememt)
Expand Down
4 changes: 3 additions & 1 deletion impeller/archivist/archive_statement.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@ class ArchiveStatement {

bool ColumnIntegral(size_t index, int64_t& item);

FML_DISALLOW_COPY_AND_ASSIGN(ArchiveStatement);
ArchiveStatement(const ArchiveStatement&) = delete;

ArchiveStatement& operator=(const ArchiveStatement&) = delete;
};

} // namespace impeller
4 changes: 3 additions & 1 deletion impeller/archivist/archive_transaction.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ class ArchiveTransaction {
ArchiveStatement& endStatement,
ArchiveStatement& rollbackStatement);

FML_DISALLOW_COPY_AND_ASSIGN(ArchiveTransaction);
ArchiveTransaction(const ArchiveTransaction&) = delete;

ArchiveTransaction& operator=(const ArchiveTransaction&) = delete;
};

} // namespace impeller
4 changes: 3 additions & 1 deletion impeller/archivist/archive_vector.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ class ArchiveVector : public Archivable {

ArchiveVector(std::vector<int64_t> keys);

FML_DISALLOW_COPY_AND_ASSIGN(ArchiveVector);
ArchiveVector(const ArchiveVector&) = delete;

ArchiveVector& operator=(const ArchiveVector&) = delete;
};

} // namespace impeller
4 changes: 3 additions & 1 deletion impeller/archivist/archivist_fixture.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ class ArchivistFixture : public ::testing::Test {

void DeleteArchiveFile() const;

FML_DISALLOW_COPY_AND_ASSIGN(ArchivistFixture);
ArchivistFixture(const ArchivistFixture&) = delete;

ArchivistFixture& operator=(const ArchivistFixture&) = delete;
};

} // namespace testing
Expand Down
8 changes: 6 additions & 2 deletions impeller/archivist/archivist_unittests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ class Sample : public Archivable {
uint64_t some_data_;
PrimaryKey name_ = ++LastSample;

FML_DISALLOW_COPY_AND_ASSIGN(Sample);
Sample(const Sample&) = delete;

Sample& operator=(const Sample&) = delete;
};

const ArchiveDef Sample::kArchiveDefinition = {
Expand Down Expand Up @@ -95,7 +97,9 @@ class SampleWithVector : public Archivable {

private:
std::vector<Sample> samples_;
FML_DISALLOW_COPY_AND_ASSIGN(SampleWithVector);
SampleWithVector(const SampleWithVector&) = delete;

SampleWithVector& operator=(const SampleWithVector&) = delete;
};

const ArchiveDef SampleWithVector::kArchiveDefinition = {
Expand Down
4 changes: 3 additions & 1 deletion impeller/base/allocation.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ class Allocation {

[[nodiscard]] bool ReserveNPOT(size_t reserved);

FML_DISALLOW_COPY_AND_ASSIGN(Allocation);
Allocation(const Allocation&) = delete;

Allocation& operator=(const Allocation&) = delete;
};

std::shared_ptr<fml::Mapping> CreateMappingWithCopy(const uint8_t* contents,
Expand Down
40 changes: 35 additions & 5 deletions impeller/base/thread.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,13 @@ class IPLR_CAPABILITY("mutex") Mutex {
private:
std::mutex mutex_;

FML_DISALLOW_COPY_ASSIGN_AND_MOVE(Mutex);
Mutex(const Mutex&) = delete;

Mutex(Mutex&&) = delete;

Mutex& operator=(const Mutex&) = delete;

Mutex& operator=(Mutex&&) = delete;
};

class IPLR_CAPABILITY("mutex") RWMutex {
Expand All @@ -48,7 +54,13 @@ class IPLR_CAPABILITY("mutex") RWMutex {
private:
std::unique_ptr<fml::SharedMutex> mutex_;

FML_DISALLOW_COPY_ASSIGN_AND_MOVE(RWMutex);
RWMutex(const RWMutex&) = delete;

RWMutex(RWMutex&&) = delete;

RWMutex& operator=(const RWMutex&) = delete;

RWMutex& operator=(RWMutex&&) = delete;
};

class IPLR_SCOPED_CAPABILITY Lock {
Expand All @@ -62,7 +74,13 @@ class IPLR_SCOPED_CAPABILITY Lock {
private:
Mutex& mutex_;

FML_DISALLOW_COPY_ASSIGN_AND_MOVE(Lock);
Lock(const Lock&) = delete;

Lock(Lock&&) = delete;

Lock& operator=(const Lock&) = delete;

Lock& operator=(Lock&&) = delete;
};

class IPLR_SCOPED_CAPABILITY ReaderLock {
Expand All @@ -77,7 +95,13 @@ class IPLR_SCOPED_CAPABILITY ReaderLock {
private:
RWMutex& mutex_;

FML_DISALLOW_COPY_ASSIGN_AND_MOVE(ReaderLock);
ReaderLock(const ReaderLock&) = delete;

ReaderLock(ReaderLock&&) = delete;

ReaderLock& operator=(const ReaderLock&) = delete;

ReaderLock& operator=(ReaderLock&&) = delete;
};

class IPLR_SCOPED_CAPABILITY WriterLock {
Expand All @@ -91,7 +115,13 @@ class IPLR_SCOPED_CAPABILITY WriterLock {
private:
RWMutex& mutex_;

FML_DISALLOW_COPY_ASSIGN_AND_MOVE(WriterLock);
WriterLock(const WriterLock&) = delete;

WriterLock(WriterLock&&) = delete;

WriterLock& operator=(const WriterLock&) = delete;

WriterLock& operator=(WriterLock&&) = delete;
};

} // namespace impeller
12 changes: 10 additions & 2 deletions impeller/base/validation.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,13 @@ class ValidationLog {
private:
std::ostringstream stream_;

FML_DISALLOW_COPY_ASSIGN_AND_MOVE(ValidationLog);
ValidationLog(const ValidationLog&) = delete;

ValidationLog(ValidationLog&&) = delete;

ValidationLog& operator=(const ValidationLog&) = delete;

ValidationLog& operator=(ValidationLog&&) = delete;
};

void ImpellerValidationBreak(const char* message);
Expand All @@ -39,7 +45,9 @@ struct ScopedValidationDisable {

~ScopedValidationDisable();

FML_DISALLOW_COPY_AND_ASSIGN(ScopedValidationDisable);
ScopedValidationDisable(const ScopedValidationDisable&) = delete;

ScopedValidationDisable& operator=(const ScopedValidationDisable&) = delete;
};

} // namespace impeller
Expand Down
4 changes: 3 additions & 1 deletion impeller/compiler/compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ class Compiler {

std::string GetDependencyNames(const std::string& separator) const;

FML_DISALLOW_COPY_AND_ASSIGN(Compiler);
Compiler(const Compiler&) = delete;

Compiler& operator=(const Compiler&) = delete;
};

} // namespace compiler
Expand Down
4 changes: 3 additions & 1 deletion impeller/compiler/compiler_test.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ class CompilerTest : public ::testing::TestWithParam<TargetPlatform> {
private:
fml::UniqueFD intermediates_directory_;

FML_DISALLOW_COPY_AND_ASSIGN(CompilerTest);
CompilerTest(const CompilerTest&) = delete;

CompilerTest& operator=(const CompilerTest&) = delete;
};

} // namespace testing
Expand Down
4 changes: 3 additions & 1 deletion impeller/compiler/includer.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ class Includer final : public shaderc::CompileOptions::IncluderInterface {
std::unique_ptr<fml::FileMapping> FindFirstMapping(
const char* requested_source);

FML_DISALLOW_COPY_AND_ASSIGN(Includer);
Includer(const Includer&) = delete;

Includer& operator=(const Includer&) = delete;
};

} // namespace compiler
Expand Down
4 changes: 3 additions & 1 deletion impeller/compiler/logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ class AutoLogger {
private:
std::stringstream& logger_;

FML_DISALLOW_COPY_AND_ASSIGN(AutoLogger);
AutoLogger(const AutoLogger&) = delete;

AutoLogger& operator=(const AutoLogger&) = delete;
};

#define COMPILER_ERROR(stream) \
Expand Down
4 changes: 3 additions & 1 deletion impeller/compiler/reflector.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,9 @@ class Reflector {
return compiler_->type_struct_member_array_stride(struct_type, index);
};

FML_DISALLOW_COPY_AND_ASSIGN(Reflector);
Reflector(const Reflector&) = delete;

Reflector& operator=(const Reflector&) = delete;
};

} // namespace compiler
Expand Down
4 changes: 3 additions & 1 deletion impeller/compiler/runtime_stage_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ class RuntimeStageData {
std::shared_ptr<fml::Mapping> shader_;
std::shared_ptr<fml::Mapping> sksl_;

FML_DISALLOW_COPY_AND_ASSIGN(RuntimeStageData);
RuntimeStageData(const RuntimeStageData&) = delete;

RuntimeStageData& operator=(const RuntimeStageData&) = delete;
};

} // namespace compiler
Expand Down
4 changes: 3 additions & 1 deletion impeller/compiler/spirv_compiler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,9 @@ class UniqueIncluder final : public shaderc::CompileOptions::IncluderInterface {
FML_CHECK(includer_);
}

FML_DISALLOW_COPY_AND_ASSIGN(UniqueIncluder);
UniqueIncluder(const UniqueIncluder&) = delete;

UniqueIncluder& operator=(const UniqueIncluder&) = delete;
};

shaderc::CompileOptions SPIRVCompilerOptions::BuildShadercOptions() const {
Expand Down
Loading