Skip to content
Snippets Groups Projects
Commit 880984e7 authored by Niklas Haas's avatar Niklas Haas
Browse files

include: mark deprecated things as deprecated

We over-ride this when compiling our own code, though, to avoid
triggering deprecation warnings in our own fallback paths.

As a side-note, also fix the `include` test to include the correct
config.h location.
parent 7fa8d4b8
No related branches found
No related tags found
No related merge requests found
Pipeline #43391 passed with stages
in 8 minutes and 58 seconds
This commit is part of merge request !124. Comments created here will be created in the context of that merge request.
......@@ -35,6 +35,9 @@
#pragma GCC visibility push(default)
#include "config.h"
#undef PL_DEPRECATED
#define PL_DEPRECATED
#include "include/libplacebo/colorspace.h"
#include "include/libplacebo/common.h"
#include "include/libplacebo/context.h"
......
......@@ -39,4 +39,7 @@ const char *pl_version(void);
// in their compiled libplacebo versions.
@extra_defs@
// Extra compiler-specific stuff
#define PL_DEPRECATED __attribute__((deprecated))
#endif // LIBPLACEBO_CONTEXT_H_
......@@ -583,7 +583,7 @@ struct pl_buf_params {
// Deprecated. Setting a type now effectively just enables some of the
// buffer usage flags. See `pl_buf_type`. This field will be removed
// in the future.
enum pl_buf_type type;
enum pl_buf_type type PL_DEPRECATED;
};
// A generic buffer, which can be used for multiple purposes (texture transfer,
......
......@@ -18,6 +18,7 @@
#ifndef LIBPLACEBO_RENDERER_H_
#define LIBPLACEBO_RENDERER_H_
#include <libplacebo/config.h>
#include <libplacebo/colorspace.h>
#include <libplacebo/filters.h>
#include <libplacebo/gpu.h>
......@@ -350,11 +351,12 @@ struct pl_frame {
// Deprecated fields provided merely for backwards compatibility. The
// use of these should be discontinued as soon as possible.
int width, height; // ignored
uint64_t signature; // ignored
const struct pl_tex *fbo; // fallback for `target.planes`
struct pl_rect2df src_rect; // fallback for `image.crop`
struct pl_rect2df dst_rect; // fallback for `target.crop`
int width PL_DEPRECATED; // ignored
int height PL_DEPRECATED;
uint64_t signature PL_DEPRECATED; // ignored
const struct pl_tex *fbo PL_DEPRECATED; // fallback for `target.planes`
struct pl_rect2df src_rect PL_DEPRECATED; // fallback for `image.crop`
struct pl_rect2df dst_rect PL_DEPRECATED; // fallback for `target.crop`
};
// Helper function to infer the chroma location offset for each plane in a
......@@ -384,10 +386,30 @@ void pl_frame_clear(const struct pl_gpu *gpu, const struct pl_frame *frame,
// Deprecated aliases, provided for backwards compatibility
#define pl_image pl_frame
#define pl_render_target pl_frame
#define pl_image_set_chroma_location pl_frame_set_chroma_location
#define pl_render_target_set_chroma_location pl_frame_set_chroma_location
#define pl_render_target_from_swapchain pl_frame_from_swapchain
#define pl_render_target_partial pl_frame_is_cropped
static PL_DEPRECATED inline void pl_image_set_chroma_location(
struct pl_frame *frame, enum pl_chroma_location chroma_loc)
{
return pl_frame_set_chroma_location(frame, chroma_loc);
}
static PL_DEPRECATED inline void pl_render_target_set_chroma_location(
struct pl_frame *frame, enum pl_chroma_location chroma_loc)
{
return pl_frame_set_chroma_location(frame, chroma_loc);
}
static PL_DEPRECATED inline void pl_render_target_from_swapchain(
struct pl_frame *out_frame, const struct pl_swapchain_frame *frame)
{
return pl_frame_from_swapchain(out_frame, frame);
}
static PL_DEPRECATED inline bool pl_render_target_partial(
const struct pl_frame *frame)
{
return pl_frame_is_cropped(frame);
}
// Render a single image to a target using the given parameters. This is
// fully dynamic, i.e. the params can change at any time. libplacebo will
......
#include "config.h"
#include "include/libplacebo/@header@"
int main()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment