Commit e903b03a authored by Michael Spang's avatar Michael Spang Committed by Commit Bot

ozone: drm: Add const to class data members where appropriate

Add const to members that are set in the ctor and never change. Also
remove the unused status field from PageFlipRequest.

Bug: none
Test: compile
Change-Id: I8bc54acd67812d860a87fab64381c7ae0f6b7b24
Reviewed-on: https://chromium-review.googlesource.com/1234223Reviewed-by: default avatarDaniel Nicoara <dnicoara@chromium.org>
Commit-Queue: Michael Spang <spang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#592543}
parent ad92aa77
......@@ -69,10 +69,10 @@ class CrtcController {
const scoped_refptr<DrmDevice> drm_;
uint32_t crtc_;
const uint32_t crtc_;
// TODO(dnicoara) Add support for hardware mirroring (multiple connectors).
uint32_t connector_;
const uint32_t connector_;
drmModeModeInfo mode_ = {};
......
......@@ -35,7 +35,7 @@ class DrmConsoleBuffer {
bool Initialize();
protected:
scoped_refptr<DrmDevice> drm_;
const scoped_refptr<DrmDevice> drm_;
// Wrapper around the native pixel memory.
sk_sp<SkSurface> surface_;
......
......@@ -260,10 +260,10 @@ bool DrmDevice::Initialize() {
// Use atomic only if kernel allows it.
is_atomic_ = SetCapability(DRM_CLIENT_CAP_ATOMIC, 1);
if (is_atomic_)
plane_manager_.reset(new HardwareDisplayPlaneManagerAtomic());
plane_manager_.reset(new HardwareDisplayPlaneManagerAtomic(this));
else
plane_manager_.reset(new HardwareDisplayPlaneManagerLegacy());
if (!plane_manager_->Initialize(this)) {
plane_manager_.reset(new HardwareDisplayPlaneManagerLegacy(this));
if (!plane_manager_->Initialize()) {
LOG(ERROR) << "Failed to initialize the plane manager for "
<< device_path_.value();
plane_manager_.reset();
......
......@@ -266,20 +266,20 @@ class DrmDevice : public base::RefCountedThreadSafe<DrmDevice> {
const base::FilePath device_path_;
// DRM device.
base::File file_;
const base::File file_;
std::unique_ptr<PageFlipManager> page_flip_manager_;
// Watcher for |fd_| listening for page flip events.
std::unique_ptr<IOWatcher> watcher_;
bool is_primary_device_;
const bool is_primary_device_;
bool is_atomic_ = false;
bool allow_addfb2_modifiers_ = false;
std::unique_ptr<GbmDevice> gbm_;
const std::unique_ptr<GbmDevice> gbm_;
DISALLOW_COPY_AND_ASSIGN(DrmDevice);
};
......
......@@ -50,7 +50,7 @@ class DrmDeviceManager {
const DrmDeviceVector& GetDrmDevices() const;
private:
std::unique_ptr<DrmDeviceGenerator> drm_device_generator_;
const std::unique_ptr<DrmDeviceGenerator> drm_device_generator_;
DrmDeviceVector devices_;
......
......@@ -57,7 +57,7 @@ class DrmDisplay {
ScreenManager* screen_manager_; // Not owned.
int64_t display_id_ = -1;
scoped_refptr<DrmDevice> drm_;
const scoped_refptr<DrmDevice> drm_;
uint32_t crtc_ = 0;
uint32_t connector_ = 0;
std::vector<drmModeModeInfo> modes_;
......
......@@ -80,17 +80,17 @@ class DrmFramebuffer : public base::RefCountedThreadSafe<DrmFramebuffer> {
private:
~DrmFramebuffer();
scoped_refptr<DrmDevice> drm_device_;
const scoped_refptr<DrmDevice> drm_device_;
uint32_t framebuffer_id_ = 0;
uint32_t framebuffer_pixel_format_ = 0;
const uint32_t framebuffer_id_;
const uint32_t framebuffer_pixel_format_;
// If |opaque_framebuffer_pixel_format_| differs from
// |framebuffer_pixel_format_| the following member is set to a valid fb,
// otherwise it is set to 0.
uint32_t opaque_framebuffer_id_ = 0;
uint32_t opaque_framebuffer_pixel_format_ = 0;
uint64_t format_modifier_ = 0;
gfx::Size size_;
const uint32_t opaque_framebuffer_id_;
const uint32_t opaque_framebuffer_pixel_format_;
const uint64_t format_modifier_;
const gfx::Size size_;
friend class base::RefCountedThreadSafe<DrmFramebuffer>;
};
......
......@@ -67,8 +67,8 @@ class DrmGpuDisplayManager {
const std::vector<std::unique_ptr<DrmDisplay>>& new_displays,
const std::vector<std::unique_ptr<DrmDisplay>>& old_displays) const;
ScreenManager* screen_manager_; // Not owned.
DrmDeviceManager* drm_device_manager_; // Not owned.
ScreenManager* const screen_manager_; // Not owned.
DrmDeviceManager* const drm_device_manager_; // Not owned.
std::vector<std::unique_ptr<DrmDisplay>> displays_;
......
......@@ -27,7 +27,7 @@ class DrmOverlayValidator {
const DrmOverlayPlaneList& last_used_planes);
private:
DrmWindow* window_; // Not owned.
DrmWindow* const window_; // Not owned.
DISALLOW_COPY_AND_ASSIGN(DrmOverlayValidator);
};
......
......@@ -94,7 +94,7 @@ class DrmThreadMessageProxy : public IPC::MessageFilter,
display::HDCPState state) const;
void OnSetHDCPStateCallback(int64_t display_id, bool success) const;
DrmThread* drm_thread_;
DrmThread* drm_thread_ = nullptr;
IPC::Sender* sender_ = nullptr;
......
......@@ -25,7 +25,7 @@ class DrmVSyncProvider : public gfx::VSyncProvider {
bool IsHWClock() const override;
private:
DrmWindowProxy* window_;
DrmWindowProxy* const window_;
DISALLOW_COPY_AND_ASSIGN(DrmVSyncProvider);
};
......
......@@ -95,10 +95,16 @@ class DrmWindow {
// Draw next frame in an animated cursor.
void OnCursorAnimationTimeout();
gfx::AcceleratedWidget widget_;
void UpdateCursorImage();
void UpdateCursorLocation();
// Draw the last set cursor & update the cursor plane.
void ResetCursor();
const gfx::AcceleratedWidget widget_;
DrmDeviceManager* device_manager_; // Not owned.
ScreenManager* screen_manager_; // Not owned.
DrmDeviceManager* const device_manager_; // Not owned.
ScreenManager* const screen_manager_; // Not owned.
// The current bounds of the window.
gfx::Rect bounds_;
......@@ -108,12 +114,6 @@ class DrmWindow {
HardwareDisplayController* controller_ = nullptr;
std::unique_ptr<DrmOverlayValidator> overlay_validator_;
void UpdateCursorImage();
void UpdateCursorLocation();
// Draw the last set cursor & update the cursor plane.
void ResetCursor();
base::RepeatingTimer cursor_timer_;
std::vector<SkBitmap> cursor_bitmaps_;
gfx::Point cursor_location_;
......
......@@ -34,9 +34,9 @@ class DrmWindowProxy {
bool SupportsGpuFences() const;
private:
gfx::AcceleratedWidget widget_;
const gfx::AcceleratedWidget widget_;
DrmThread* drm_thread_;
DrmThread* const drm_thread_;
DISALLOW_COPY_AND_ASSIGN(DrmWindowProxy);
};
......
......@@ -49,7 +49,7 @@ class GbmOverlaySurface : public OverlaySurface {
std::unique_ptr<gfx::GpuFence> out_fence);
void OnPresentation(const gfx::PresentationFeedback& presentation_feedback);
std::unique_ptr<DrmWindowProxy> window_;
const std::unique_ptr<DrmWindowProxy> window_;
Frame unsubmitted_frame_;
Frame submitted_frame_;
Frame presented_frame_;
......
......@@ -50,9 +50,9 @@ class GbmPixmap : public gfx::NativePixmap {
private:
~GbmPixmap() override;
GbmSurfaceFactory* surface_manager_;
std::unique_ptr<GbmBuffer> buffer_;
scoped_refptr<DrmFramebuffer> framebuffer_;
GbmSurfaceFactory* const surface_manager_;
const std::unique_ptr<GbmBuffer> buffer_;
const scoped_refptr<DrmFramebuffer> framebuffer_;
DISALLOW_COPY_AND_ASSIGN(GbmPixmap);
};
......
......@@ -87,7 +87,7 @@ class GbmSurfaceFactory : public SurfaceFactoryOzone {
base::ThreadChecker thread_checker_;
DrmThreadProxy* drm_thread_proxy_;
DrmThreadProxy* const drm_thread_proxy_;
std::map<gfx::AcceleratedWidget, GbmSurfaceless*> widget_to_surface_map_;
......
......@@ -98,16 +98,16 @@ class GbmSurfaceless : public gl::SurfacelessEGL {
std::unique_ptr<gfx::GpuFence> out_fence);
void OnPresentation(const gfx::PresentationFeedback& feedback);
GbmSurfaceFactory* surface_factory_;
std::unique_ptr<DrmWindowProxy> window_;
GbmSurfaceFactory* const surface_factory_;
const std::unique_ptr<DrmWindowProxy> window_;
std::vector<DrmOverlayPlane> planes_;
// The native surface. Deleting this is allowed to free the EGLNativeWindow.
gfx::AcceleratedWidget widget_;
const gfx::AcceleratedWidget widget_;
std::unique_ptr<gfx::VSyncProvider> vsync_provider_;
std::vector<std::unique_ptr<PendingFrame>> unsubmitted_frames_;
std::unique_ptr<PendingFrame> submitted_frame_;
bool has_implicit_external_sync_;
const bool has_implicit_external_sync_;
bool last_swap_buffers_result_ = true;
bool supports_plane_gpu_fences_ = false;
bool use_egl_fence_sync_ = true;
......
......@@ -70,7 +70,7 @@ class HardwareDisplayPlane {
DrmDevice::Property plane_ctm;
};
uint32_t id_;
const uint32_t id_;
uint32_t crtc_mask_ = 0;
Properties properties_ = {};
......
......@@ -49,15 +49,13 @@ HardwareDisplayPlaneManager::CrtcState::~CrtcState() = default;
HardwareDisplayPlaneManager::CrtcState::CrtcState(CrtcState&&) = default;
HardwareDisplayPlaneManager::HardwareDisplayPlaneManager() : drm_(nullptr) {
}
HardwareDisplayPlaneManager::HardwareDisplayPlaneManager(DrmDevice* drm)
: drm_(drm) {}
HardwareDisplayPlaneManager::~HardwareDisplayPlaneManager() {
}
bool HardwareDisplayPlaneManager::Initialize(DrmDevice* drm) {
drm_ = drm;
bool HardwareDisplayPlaneManager::Initialize() {
// Try to get all of the planes if possible, so we don't have to try to
// discover hidden primary planes.
#if defined(DRM_CLIENT_CAP_UNIVERSAL_PLANES)
......@@ -65,10 +63,10 @@ bool HardwareDisplayPlaneManager::Initialize(DrmDevice* drm) {
drm_->SetCapability(DRM_CLIENT_CAP_UNIVERSAL_PLANES, 1);
#endif
if (!InitializeCrtcState(drm))
if (!InitializeCrtcState())
return false;
if (!InitializePlanes(drm))
if (!InitializePlanes())
return false;
std::sort(planes_.begin(), planes_.end(),
......@@ -304,8 +302,8 @@ bool HardwareDisplayPlaneManager::SetGammaCorrection(
return CommitGammaCorrection(*crtc_props);
}
bool HardwareDisplayPlaneManager::InitializeCrtcState(DrmDevice* drm) {
ScopedDrmResourcesPtr resources(drm->GetResources());
bool HardwareDisplayPlaneManager::InitializeCrtcState() {
ScopedDrmResourcesPtr resources(drm_->GetResources());
if (!resources) {
PLOG(ERROR) << "Failed to get resources.";
return false;
......@@ -318,7 +316,7 @@ bool HardwareDisplayPlaneManager::InitializeCrtcState(DrmDevice* drm) {
state.properties.id = resources->crtcs[i];
ScopedDrmObjectPropertyPtr props(
drm->GetObjectProperties(resources->crtcs[i], DRM_MODE_OBJECT_CRTC));
drm_->GetObjectProperties(resources->crtcs[i], DRM_MODE_OBJECT_CRTC));
if (!props) {
PLOG(ERROR) << "Failed to get CRTC properties for crtc_id="
<< state.properties.id;
......@@ -327,16 +325,16 @@ bool HardwareDisplayPlaneManager::InitializeCrtcState(DrmDevice* drm) {
// These properties are optional. If they don't exist we can tell by the
// invalid ID.
GetDrmPropertyForName(drm, props.get(), "CTM", &state.properties.ctm);
GetDrmPropertyForName(drm, props.get(), "GAMMA_LUT",
GetDrmPropertyForName(drm_, props.get(), "CTM", &state.properties.ctm);
GetDrmPropertyForName(drm_, props.get(), "GAMMA_LUT",
&state.properties.gamma_lut);
GetDrmPropertyForName(drm, props.get(), "GAMMA_LUT_SIZE",
GetDrmPropertyForName(drm_, props.get(), "GAMMA_LUT_SIZE",
&state.properties.gamma_lut_size);
GetDrmPropertyForName(drm, props.get(), "DEGAMMA_LUT",
GetDrmPropertyForName(drm_, props.get(), "DEGAMMA_LUT",
&state.properties.degamma_lut);
GetDrmPropertyForName(drm, props.get(), "DEGAMMA_LUT_SIZE",
GetDrmPropertyForName(drm_, props.get(), "DEGAMMA_LUT_SIZE",
&state.properties.degamma_lut_size);
GetDrmPropertyForName(drm, props.get(), "OUT_FENCE_PTR",
GetDrmPropertyForName(drm_, props.get(), "OUT_FENCE_PTR",
&state.properties.out_fence_ptr);
num_crtcs_with_out_fence_ptr += (state.properties.out_fence_ptr.id != 0);
......
......@@ -56,12 +56,12 @@ struct HardwareDisplayPlaneList {
class HardwareDisplayPlaneManager {
public:
HardwareDisplayPlaneManager();
HardwareDisplayPlaneManager(DrmDevice* drm);
virtual ~HardwareDisplayPlaneManager();
// This parses information from the drm driver, adding any new planes
// or crtcs found.
bool Initialize(DrmDevice* drm);
bool Initialize();
// Clears old frame state out. Must be called before any AssignOverlayPlanes
// calls.
......@@ -159,9 +159,9 @@ class HardwareDisplayPlaneManager {
DISALLOW_COPY_AND_ASSIGN(CrtcState);
};
bool InitializeCrtcState(DrmDevice* drm);
bool InitializeCrtcState();
virtual bool InitializePlanes(DrmDevice* drm) = 0;
virtual bool InitializePlanes() = 0;
virtual bool SetPlaneData(HardwareDisplayPlaneList* plane_list,
HardwareDisplayPlane* hw_plane,
......@@ -199,7 +199,7 @@ class HardwareDisplayPlaneManager {
// Object containing the connection to the graphics device and wraps the API
// calls to control it. Not owned.
DrmDevice* drm_;
DrmDevice* const drm_;
bool has_universal_planes_ = false;
......
......@@ -51,8 +51,9 @@ std::unique_ptr<gfx::GpuFence> CreateMergedGpuFenceFromFDs(
} // namespace
HardwareDisplayPlaneManagerAtomic::HardwareDisplayPlaneManagerAtomic() {
}
HardwareDisplayPlaneManagerAtomic::HardwareDisplayPlaneManagerAtomic(
DrmDevice* drm)
: HardwareDisplayPlaneManager(drm) {}
HardwareDisplayPlaneManagerAtomic::~HardwareDisplayPlaneManagerAtomic() {
}
......@@ -247,8 +248,8 @@ bool HardwareDisplayPlaneManagerAtomic::SetPlaneData(
return true;
}
bool HardwareDisplayPlaneManagerAtomic::InitializePlanes(DrmDevice* drm) {
ScopedDrmPlaneResPtr plane_resources = drm->GetPlaneResources();
bool HardwareDisplayPlaneManagerAtomic::InitializePlanes() {
ScopedDrmPlaneResPtr plane_resources = drm_->GetPlaneResources();
if (!plane_resources) {
PLOG(ERROR) << "Failed to get plane resources.";
return false;
......@@ -258,7 +259,7 @@ bool HardwareDisplayPlaneManagerAtomic::InitializePlanes(DrmDevice* drm) {
std::unique_ptr<HardwareDisplayPlane> plane(
CreatePlane(plane_resources->planes[i]));
if (plane->Initialize(drm))
if (plane->Initialize(drm_))
planes_.push_back(std::move(plane));
}
......
......@@ -14,7 +14,7 @@ namespace ui {
class HardwareDisplayPlaneManagerAtomic : public HardwareDisplayPlaneManager {
public:
HardwareDisplayPlaneManagerAtomic();
HardwareDisplayPlaneManagerAtomic(DrmDevice* drm);
~HardwareDisplayPlaneManagerAtomic() override;
// HardwareDisplayPlaneManager:
......@@ -41,7 +41,7 @@ class HardwareDisplayPlaneManagerAtomic : public HardwareDisplayPlaneManager {
CrtcController* crtc) override;
private:
bool InitializePlanes(DrmDevice* drm) override;
bool InitializePlanes() override;
std::unique_ptr<HardwareDisplayPlane> CreatePlane(uint32_t plane_id) override;
bool CommitColorMatrix(const CrtcProperties& crtc_props) override;
bool CommitGammaCorrection(const CrtcProperties& crtc_props) override;
......
......@@ -36,8 +36,9 @@ ui::DrmOverlayPlaneList WaitForPlaneFences(ui::DrmOverlayPlaneList planes) {
} // namespace
HardwareDisplayPlaneManagerLegacy::HardwareDisplayPlaneManagerLegacy() {
}
HardwareDisplayPlaneManagerLegacy::HardwareDisplayPlaneManagerLegacy(
DrmDevice* drm)
: HardwareDisplayPlaneManager(drm) {}
HardwareDisplayPlaneManagerLegacy::~HardwareDisplayPlaneManagerLegacy() {
}
......@@ -125,8 +126,8 @@ void HardwareDisplayPlaneManagerLegacy::RequestPlanesReadyCallback(
std::move(callback));
}
bool HardwareDisplayPlaneManagerLegacy::InitializePlanes(DrmDevice* drm) {
ScopedDrmPlaneResPtr plane_resources = drm->GetPlaneResources();
bool HardwareDisplayPlaneManagerLegacy::InitializePlanes() {
ScopedDrmPlaneResPtr plane_resources = drm_->GetPlaneResources();
if (!plane_resources) {
PLOG(ERROR) << "Failed to get plane resources.";
return false;
......@@ -136,7 +137,7 @@ bool HardwareDisplayPlaneManagerLegacy::InitializePlanes(DrmDevice* drm) {
std::unique_ptr<HardwareDisplayPlane> plane(
CreatePlane(plane_resources->planes[i]));
if (!plane->Initialize(drm))
if (!plane->Initialize(drm_))
continue;
// Overlays are not supported on the legacy path, so ignore all overlay
......@@ -159,7 +160,7 @@ bool HardwareDisplayPlaneManagerLegacy::InitializePlanes(DrmDevice* drm) {
}) == planes_.end()) {
std::unique_ptr<HardwareDisplayPlane> dummy_plane(
new HardwareDisplayPlaneDummy(id, 1 << i));
if (dummy_plane->Initialize(drm)) {
if (dummy_plane->Initialize(drm_)) {
planes_.push_back(std::move(dummy_plane));
}
}
......
......@@ -14,7 +14,7 @@ namespace ui {
class HardwareDisplayPlaneManagerLegacy : public HardwareDisplayPlaneManager {
public:
HardwareDisplayPlaneManagerLegacy();
HardwareDisplayPlaneManagerLegacy(DrmDevice* device);
~HardwareDisplayPlaneManagerLegacy() override;
// HardwareDisplayPlaneManager:
......@@ -35,7 +35,7 @@ class HardwareDisplayPlaneManagerLegacy : public HardwareDisplayPlaneManager {
base::OnceCallback<void(DrmOverlayPlaneList)> callback) override;
protected:
bool InitializePlanes(DrmDevice* drm) override;
bool InitializePlanes() override;
bool SetPlaneData(HardwareDisplayPlaneList* plane_list,
HardwareDisplayPlane* hw_plane,
const DrmOverlayPlane& overlay,
......
......@@ -854,11 +854,13 @@ void HardwareDisplayPlaneManagerPlanesReadyTest::RequestPlanesReady(
}
void HardwareDisplayPlaneManagerPlanesReadyTest::UseLegacyManager() {
plane_manager_ = std::make_unique<ui::HardwareDisplayPlaneManagerLegacy>();
plane_manager_ =
std::make_unique<ui::HardwareDisplayPlaneManagerLegacy>(fake_drm_.get());
}
void HardwareDisplayPlaneManagerPlanesReadyTest::UseAtomicManager() {
plane_manager_ = std::make_unique<ui::HardwareDisplayPlaneManagerAtomic>();
plane_manager_ =
std::make_unique<ui::HardwareDisplayPlaneManagerAtomic>(fake_drm_.get());
}
TEST_F(HardwareDisplayPlaneManagerPlanesReadyTest,
......@@ -936,11 +938,11 @@ class HardwareDisplayPlaneAtomicMock : public ui::HardwareDisplayPlaneAtomic {
};
TEST(HardwareDisplayPlaneManagerAtomic, EnableBlend) {
auto plane_manager =
std::make_unique<ui::HardwareDisplayPlaneManagerAtomic>();
auto gbm_device = std::make_unique<ui::MockGbmDevice>();
auto drm_device =
base::MakeRefCounted<ui::MockDrmDevice>(std::move(gbm_device));
auto plane_manager =
std::make_unique<ui::HardwareDisplayPlaneManagerAtomic>(drm_device.get());
ui::HardwareDisplayPlaneList plane_list;
HardwareDisplayPlaneAtomicMock hw_plane;
std::unique_ptr<ui::GbmBuffer> buffer =
......
......@@ -92,7 +92,7 @@ MockDrmDevice::MockDrmDevice(std::unique_ptr<GbmDevice> gbm_device)
page_flip_expectation_(true),
create_dumb_buffer_expectation_(true),
current_framebuffer_(0) {
plane_manager_.reset(new HardwareDisplayPlaneManagerLegacy());
plane_manager_.reset(new HardwareDisplayPlaneManagerLegacy(this));
}
// static
......@@ -141,12 +141,12 @@ bool MockDrmDevice::InitializeStateWithResult(
plane_properties_ = plane_properties;
property_names_ = property_names;
if (use_atomic) {
plane_manager_.reset(new HardwareDisplayPlaneManagerAtomic());
plane_manager_.reset(new HardwareDisplayPlaneManagerAtomic(this));
} else {
plane_manager_.reset(new HardwareDisplayPlaneManagerLegacy());
plane_manager_.reset(new HardwareDisplayPlaneManagerLegacy(this));
}
return plane_manager_->Initialize(this);
return plane_manager_->Initialize();
}
MockDrmDevice::~MockDrmDevice() {}
......
......@@ -45,8 +45,7 @@ class PageFlipRequest : public base::RefCounted<PageFlipRequest> {
PresentationOnceCallback callback_;
int page_flip_count_ = 0;
base::TimeDelta refresh_interval_;
gfx::SwapResult result_ = gfx::SwapResult::SWAP_ACK;
const base::TimeDelta refresh_interval_;
DISALLOW_COPY_AND_ASSIGN(PageFlipRequest);
};
......
......@@ -111,7 +111,7 @@ class DrmCursor : public CursorDelegateEvdev {
// The bounds that the cursor is confined to in |window|.
gfx::Rect confined_bounds_;
DrmWindowHostManager* window_manager_; // Not owned.
DrmWindowHostManager* const window_manager_; // Not owned.
std::unique_ptr<DrmCursorProxy> proxy_;
......
......@@ -58,13 +58,13 @@ class DrmDeviceConnector : public GpuPlatformSupportHost {
bool am_running_in_ws_mode() { return !!ws_runner_; }
// This will be present if the Viz host has a service manager.
service_manager::Connector* connector_;
service_manager::Connector* const connector_;
// This will be used if we are operating under content/gpu without a service
// manager.
GpuHostBindInterfaceCallback binder_callback_;
scoped_refptr<HostDrmDevice> host_drm_device_;
const scoped_refptr<HostDrmDevice> host_drm_device_;
scoped_refptr<base::SingleThreadTaskRunner> ws_runner_;
DISALLOW_COPY_AND_ASSIGN(DrmDeviceConnector);
......
......@@ -56,7 +56,7 @@ class DrmDisplayHost : public GpuThreadObserver {
// Calls all the callbacks with failure.
void ClearCallbacks();
GpuThreadAdapter* sender_; // Not owned.
GpuThreadAdapter* const sender_; // Not owned.
std::unique_ptr<display::DisplaySnapshot> snapshot_;
......
......@@ -98,17 +98,17 @@ class DrmDisplayHostManager : public DeviceEventObserver, GpuThreadObserver {
void NotifyDisplayDelegate() const;
GpuThreadAdapter* proxy_; // Not owned.
DeviceManager* device_manager_; // Not owned.
DrmOverlayManager* overlay_manager_; // Not owned.
InputControllerEvdev* input_controller_; // Not owned.
GpuThreadAdapter* const proxy_; // Not owned.
DeviceManager* const device_manager_; // Not owned.
DrmOverlayManager* const overlay_manager_; // Not owned.
InputControllerEvdev* const input_controller_; // Not owned.
DrmNativeDisplayDelegate* delegate_ = nullptr; // Not owned.
// File path for the primary graphics card which is opened by default in the
// GPU process. We'll avoid opening this in hotplug events since it will race
// with the GPU process trying to open it and aquire DRM master.
base::FilePath primary_graphics_card_path_;
const base::FilePath primary_graphics_card_path_;
// Keeps track if there is a dummy display. This happens on initialization
// when there is no connection to the GPU to update the displays.
......
......@@ -128,7 +128,7 @@ class DrmGpuPlatformSupportHost : public GpuPlatformSupportHost,
DrmDisplayHostManager* display_manager_; // Not owned.
DrmOverlayManager* overlay_manager_; // Not owned.
DrmCursor* cursor_; // Not owned.
DrmCursor* const cursor_; // Not owned.
base::ObserverList<GpuThreadObserver>::Unchecked gpu_thread_observers_;
base::WeakPtr<DrmGpuPlatformSupportHost> weak_ptr_;
......
......@@ -49,7 +49,7 @@ class DrmNativeDisplayDelegate : public display::NativeDisplayDelegate {
display::FakeDisplayController* GetFakeDisplayController() override;
private:
DrmDisplayHostManager* display_manager_; // Not owned.
DrmDisplayHostManager* const display_manager_; // Not owned.
base::ObserverList<display::NativeDisplayObserver>::Unchecked observers_;
......
......@@ -40,8 +40,8 @@ class DrmOverlayCandidatesHost : public OverlayCandidatesOzone {
void CheckOverlaySupport(OverlaySurfaceCandidateList* candidates) override;
private:
DrmOverlayManager* overlay_manager_; // Not owned.
gfx::AcceleratedWidget widget_;
DrmOverlayManager* const overlay_manager_; // Not owned.
const gfx::AcceleratedWidget widget_;
DISALLOW_COPY_AND_ASSIGN(DrmOverlayCandidatesHost);
};
......
......@@ -70,8 +70,8 @@ class DrmOverlayManager : public OverlayManagerOzone {
// Whether we have DRM atomic capabilities and we can support HW overlays.
bool supports_overlays_ = false;
GpuThreadAdapter* proxy_; // Not owned.
DrmWindowHostManager* window_manager_; // Not owned.
GpuThreadAdapter* const proxy_; // Not owned.
DrmWindowHostManager* const window_manager_; // Not owned.
// List of all OverlaySurfaceCandidate instances which have been requested
// for validation and/or validated.
......
......@@ -92,16 +92,16 @@ class DrmWindowHost : public PlatformWindow,
private:
void SendBoundsChange();
PlatformWindowDelegate* delegate_; // Not owned.
GpuThreadAdapter* sender_; // Not owned.
EventFactoryEvdev* event_factory_; // Not owned.
DrmCursor* cursor_; // Not owned.
DrmWindowHostManager* window_manager_; // Not owned.
DrmDisplayHostManager* display_manager_; // Not owned.
DrmOverlayManager* overlay_manager_; // Not owned.
PlatformWindowDelegate* const delegate_; // Not owned.
GpuThreadAdapter* const sender_; // Not owned.
EventFactoryEvdev* const event_factory_; // Not owned.
DrmCursor* const cursor_; // Not owned.
DrmWindowHostManager* const window_manager_; // Not owned.
DrmDisplayHostManager* const display_manager_; // Not owned.
DrmOverlayManager* const overlay_manager_; // Not owned.
gfx::Rect bounds_;
gfx::AcceleratedWidget widget_;
const gfx::AcceleratedWidget widget_;
gfx::Rect cursor_confined_bounds_;
......
......@@ -151,7 +151,7 @@ class HostDrmDevice : public base::RefCountedThreadSafe<HostDrmDevice>,
DrmDisplayHostManager* display_manager_; // Not owned.
DrmOverlayManager* overlay_manager_; // Not owned.
DrmCursor* cursor_; // Not owned.
DrmCursor* const cursor_; // Not owned.
std::unique_ptr<HostCursorProxy> cursor_proxy_;
......
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