Commit 4b2a9cbc by Maksim Sisov Committed by Commit Bot

move duplicated SwapControlData to rendergl_utils.

Both DisplayOzone and DisplayGLX have SwapControlData declared and defined. In the future, when both of them will be compiled (DisplayGLX will be required for Ozone/X11), they will result in a compilation error stating about multiple definitions of the struct. Thus, move that rendergl_utils. Bug: chromium:1084458 Change-Id: Ib174d0e8de1ac4773c841fe286175358acb15d79 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2210702 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent 6169aca6
...@@ -86,11 +86,6 @@ int ChooseCRTC(int fd, drmModeConnectorPtr conn) ...@@ -86,11 +86,6 @@ int ChooseCRTC(int fd, drmModeConnectorPtr conn)
namespace rx namespace rx
{ {
// TODO(fjhenigman) Implement swap control. Until then this is unused.
SwapControlData::SwapControlData()
: targetSwapInterval(0), maxSwapInterval(-1), currentSwapInterval(-1)
{}
DisplayGbm::Buffer::Buffer(DisplayGbm *display, DisplayGbm::Buffer::Buffer(DisplayGbm *display,
uint32_t useFlags, uint32_t useFlags,
uint32_t gbmFormat, uint32_t gbmFormat,
......
...@@ -30,21 +30,9 @@ namespace rx ...@@ -30,21 +30,9 @@ namespace rx
class FramebufferGL; class FramebufferGL;
class RendererEGL; class RendererEGL;
// TODO(fjhenigman) Implement swap control. The following struct will be used for that. struct SwapControlData;
// State-tracking data for the swap control to allow DisplayGbm to remember per
// drawable information for swap control.
struct SwapControlData final
{
SwapControlData();
// Set by the drawable
int targetSwapInterval;
// DisplayGbm-side state-tracking
int maxSwapInterval;
int currentSwapInterval;
};
// TODO(fjhenigman) Implement swap control. The SwapControlData struct will be used for that.
class DisplayGbm final : public DisplayEGL class DisplayGbm final : public DisplayEGL
{ {
public: public:
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include "libANGLE/renderer/gl/SurfaceGL.h" #include "libANGLE/renderer/gl/SurfaceGL.h"
#include "libANGLE/renderer/gl/egl/gbm/DisplayGbm.h" #include "libANGLE/renderer/gl/egl/gbm/DisplayGbm.h"
#include "libANGLE/renderer/gl/renderergl_utils.h"
namespace rx namespace rx
{ {
......
...@@ -43,10 +43,6 @@ static int IgnoreX11Errors(Display *, XErrorEvent *) ...@@ -43,10 +43,6 @@ static int IgnoreX11Errors(Display *, XErrorEvent *)
return 0; return 0;
} }
SwapControlData::SwapControlData()
: targetSwapInterval(0), maxSwapInterval(-1), currentSwapInterval(-1)
{}
class FunctionsGLGLX : public FunctionsGL class FunctionsGLGLX : public FunctionsGL
{ {
public: public:
......
...@@ -22,19 +22,7 @@ namespace rx ...@@ -22,19 +22,7 @@ namespace rx
class FunctionsGLX; class FunctionsGLX;
class WorkerContext; class WorkerContext;
// State-tracking data for the swap control to allow DisplayGLX to remember per struct SwapControlData;
// drawable information for swap control.
struct SwapControlData
{
SwapControlData();
// Set by the drawable
int targetSwapInterval;
// DisplayGLX-side state-tracking
int maxSwapInterval;
int currentSwapInterval;
};
class DisplayGLX : public DisplayGL class DisplayGLX : public DisplayGL
{ {
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include "libANGLE/renderer/gl/glx/DisplayGLX.h" #include "libANGLE/renderer/gl/glx/DisplayGLX.h"
#include "libANGLE/renderer/gl/glx/SurfaceGLX.h" #include "libANGLE/renderer/gl/glx/SurfaceGLX.h"
#include "libANGLE/renderer/gl/glx/platform_glx.h" #include "libANGLE/renderer/gl/glx/platform_glx.h"
#include "libANGLE/renderer/gl/renderergl_utils.h"
namespace rx namespace rx
{ {
......
...@@ -36,6 +36,10 @@ using angle::CheckedNumeric; ...@@ -36,6 +36,10 @@ using angle::CheckedNumeric;
namespace rx namespace rx
{ {
SwapControlData::SwapControlData()
: targetSwapInterval(0), maxSwapInterval(-1), currentSwapInterval(-1)
{}
VendorID GetVendorID(const FunctionsGL *functions) VendorID GetVendorID(const FunctionsGL *functions)
{ {
std::string nativeVendorString(reinterpret_cast<const char *>(functions->getString(GL_VENDOR))); std::string nativeVendorString(reinterpret_cast<const char *>(functions->getString(GL_VENDOR)));
......
...@@ -47,6 +47,20 @@ enum class MultiviewImplementationTypeGL ...@@ -47,6 +47,20 @@ enum class MultiviewImplementationTypeGL
UNSPECIFIED UNSPECIFIED
}; };
// State-tracking data for the swap control to allow DisplayGL to remember per
// drawable information for swap control.
struct SwapControlData
{
SwapControlData();
// Set by the drawable
int targetSwapInterval;
// DisplayGL-side state-tracking
int maxSwapInterval;
int currentSwapInterval;
};
VendorID GetVendorID(const FunctionsGL *functions); VendorID GetVendorID(const FunctionsGL *functions);
// Helpers for extracting the GL helper objects out of a context // Helpers for extracting the GL helper objects out of a context
......
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