From 63e20896391dda07baa25733cc023db233945f8b Mon Sep 17 00:00:00 2001 From: Camillo Lugaresi Date: Tue, 15 Nov 2022 18:35:04 -0800 Subject: [PATCH] Deprecate a bunch of old stuff in GlCalculatorHelper PiperOrigin-RevId: 488813296 --- mediapipe/gpu/BUILD | 1 + mediapipe/gpu/gl_calculator_helper.h | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/mediapipe/gpu/BUILD b/mediapipe/gpu/BUILD index b0c1c22b2..4fb59f1b5 100644 --- a/mediapipe/gpu/BUILD +++ b/mediapipe/gpu/BUILD @@ -784,6 +784,7 @@ cc_library( ":shader_util", "//mediapipe/framework:calculator_framework", "//mediapipe/framework:calculator_cc_proto", + "@com_google_absl//absl/base:core_headers", "//mediapipe/framework:calculator_context", "//mediapipe/framework:calculator_node", "//mediapipe/framework:calculator_contract", diff --git a/mediapipe/gpu/gl_calculator_helper.h b/mediapipe/gpu/gl_calculator_helper.h index 727be7826..af897bbe9 100644 --- a/mediapipe/gpu/gl_calculator_helper.h +++ b/mediapipe/gpu/gl_calculator_helper.h @@ -17,6 +17,7 @@ #include +#include "absl/base/attributes.h" #include "absl/memory/memory.h" #include "mediapipe/framework/calculator_context.h" #include "mediapipe/framework/calculator_contract.h" @@ -61,6 +62,7 @@ class GlCalculatorHelper { // Can be used to initialize the helper outside of a calculator. Useful for // testing. void InitializeForTest(GpuResources* gpu_resources); + ABSL_DEPRECATED("Use InitializeForTest(GpuResources)") void InitializeForTest(GpuSharedData* gpu_shared); // This method can be called from GetContract to set up the needed GPU @@ -69,6 +71,7 @@ class GlCalculatorHelper { // This method can be called from FillExpectations to set the correct types // for the shared GL input side packet(s). + ABSL_DEPRECATED("Use UpdateContract") static absl::Status SetupInputSidePackets(PacketTypeSet* input_side_packets); // Execute the provided function within the helper's GL context. On some @@ -235,12 +238,14 @@ class GlTexture { // it is better to keep const-safety and accept having two versions of the // same thing. template +ABSL_DEPRECATED("Only for legacy calculators") auto TagOrIndex(const T& collection, const std::string& tag, int index) -> decltype(collection.Tag(tag)) { return collection.UsesTags() ? collection.Tag(tag) : collection.Index(index); } template +ABSL_DEPRECATED("Only for legacy calculators") auto TagOrIndex(T* collection, const std::string& tag, int index) -> decltype(collection->Tag(tag)) { return collection->UsesTags() ? collection->Tag(tag) @@ -248,12 +253,14 @@ auto TagOrIndex(T* collection, const std::string& tag, int index) } template +ABSL_DEPRECATED("Only for legacy calculators") bool HasTagOrIndex(const T& collection, const std::string& tag, int index) { return collection.UsesTags() ? collection.HasTag(tag) : index < collection.NumEntries(); } template +ABSL_DEPRECATED("Only for legacy calculators") bool HasTagOrIndex(T* collection, const std::string& tag, int index) { return collection->UsesTags() ? collection->HasTag(tag) : index < collection->NumEntries();