Commit 149e07a1 authored by Daniel Nicoara's avatar Daniel Nicoara Committed by Commit Bot

Remove unnecessary overlay prints in cast GL surface

Video overlays on the Cast platform follow a special path handled by the
hardware via a separate API. The Cast overlay strategy was updated in
3737028e to accept the overlay rather
than relying on the Ozone platform to make the decision.

The logging was moved in OverlayStrategyUnderlayCast and
VideoPlaneController.

Bug: None
Test: Compiled cast_shell
Change-Id: Ide14380ad626d7bcd9ba00cb7f74daab292f2f80
Reviewed-on: https://chromium-review.googlesource.com/1134495Reviewed-by: default avatarLuke Halliwell <halliwell@chromium.org>
Commit-Queue: Daniel Nicoara <dnicoara@chromium.org>
Cr-Commit-Position: refs/heads/master@{#577607}
parent bc77c6ee
......@@ -86,31 +86,6 @@ void GLOzoneEglCast::TerminateDisplay() {
DCHECK_EQ(terminate_result, static_cast<EGLBoolean>(EGL_TRUE));
}
void GLOzoneEglCast::OnSwapBuffers() {
DCHECK(overlay_count_ == 0 || overlay_count_ == 1);
// Logging for overlays to help diagnose bugs when nothing is visible on
// screen. Logging this every frame would be overwhelming, so we just
// log on the transitions from 0 overlays -> 1 overlay and vice versa.
if (overlay_count_ == 0 && previous_frame_overlay_count_ != 0) {
LOG(INFO) << "Overlays deactivated";
} else if (overlay_count_ != 0 && previous_frame_overlay_count_ == 0) {
LOG(INFO) << "Overlays activated: " << overlay_bounds_.ToString();
} else if (overlay_count_ == previous_frame_overlay_count_ &&
overlay_bounds_ != previous_frame_overlay_bounds_) {
LOG(INFO) << "Overlay geometry changed to " << overlay_bounds_.ToString();
}
previous_frame_overlay_count_ = overlay_count_;
previous_frame_overlay_bounds_ = overlay_bounds_;
overlay_count_ = 0;
}
void GLOzoneEglCast::OnOverlayScheduled(const gfx::Rect& display_bounds) {
++overlay_count_;
overlay_bounds_ = display_bounds;
}
scoped_refptr<gl::GLSurface> GLOzoneEglCast::CreateViewGLSurface(
gfx::AcceleratedWidget widget) {
// Verify requested widget dimensions match our current display size.
......
......@@ -40,10 +40,6 @@ class GLOzoneEglCast : public GLOzoneEGL {
bool ResizeDisplay(gfx::Size viewport_size);
void TerminateDisplay();
// API for keeping track of overlays per frame for logging purposes
void OnSwapBuffers();
void OnOverlayScheduled(const gfx::Rect& display_bounds);
private:
void CreateDisplayTypeAndWindowIfNeeded();
void InitializeHardwareIfNeeded();
......@@ -55,12 +51,6 @@ class GLOzoneEglCast : public GLOzoneEGL {
gfx::Size display_size_;
std::unique_ptr<chromecast::CastEglPlatform> egl_platform_;
// Overlays scheduled in current and previous frames:
int overlay_count_ = 0;
gfx::Rect overlay_bounds_;
int previous_frame_overlay_count_ = 0;
gfx::Rect previous_frame_overlay_bounds_;
DISALLOW_COPY_AND_ASSIGN(GLOzoneEglCast);
};
......
......@@ -60,15 +60,6 @@ bool GLSurfaceCast::SupportsSwapBuffersWithBounds() {
return supports_swap_buffer_with_bounds_;
}
gfx::SwapResult GLSurfaceCast::SwapBuffers(
const PresentationCallback& callback) {
gfx::SwapResult result = NativeViewGLSurfaceEGL::SwapBuffers(callback);
if (result == gfx::SwapResult::SWAP_ACK)
parent_->OnSwapBuffers();
return result;
}
gfx::SwapResult GLSurfaceCast::SwapBuffersWithBounds(
const std::vector<gfx::Rect>& rects,
const PresentationCallback& callback) {
......@@ -83,11 +74,8 @@ gfx::SwapResult GLSurfaceCast::SwapBuffersWithBounds(
rects_data[i * 4 + 2] = rects[i].width();
rects_data[i * 4 + 3] = rects[i].height();
}
gfx::SwapResult result =
NativeViewGLSurfaceEGL::SwapBuffersWithDamage(rects_data, callback);
if (result == gfx::SwapResult::SWAP_ACK)
parent_->OnSwapBuffers();
return result;
return NativeViewGLSurfaceEGL::SwapBuffersWithDamage(rects_data, callback);
}
bool GLSurfaceCast::Resize(const gfx::Size& size,
......
......@@ -25,7 +25,6 @@ class GLSurfaceCast : public gl::NativeViewGLSurfaceEGL {
// gl::GLSurface:
bool SupportsSwapBuffersWithBounds() override;
gfx::SwapResult SwapBuffers(const PresentationCallback& callback) override;
gfx::SwapResult SwapBuffersWithBounds(
const std::vector<gfx::Rect>& rects,
const PresentationCallback& callback) override;
......
......@@ -47,7 +47,7 @@ class DummySurface : public SurfaceOzoneCanvas {
class CastPixmap : public gfx::NativePixmap {
public:
explicit CastPixmap(GLOzoneEglCast* parent) : parent_(parent) {}
CastPixmap() {}
bool AreDmaBufFdsValid() const override { return false; }
size_t GetDmaBufFdCount() const override { return 0; }
......@@ -68,8 +68,7 @@ class CastPixmap : public gfx::NativePixmap {
const gfx::RectF& crop_rect,
bool enable_blend,
std::unique_ptr<gfx::GpuFence> gpu_fence) override {
parent_->OnOverlayScheduled(display_bounds);
return true;
return false;
}
gfx::NativePixmapHandle ExportHandle() override {
return gfx::NativePixmapHandle();
......@@ -78,8 +77,6 @@ class CastPixmap : public gfx::NativePixmap {
private:
~CastPixmap() override {}
GLOzoneEglCast* parent_;
DISALLOW_COPY_AND_ASSIGN(CastPixmap);
};
......@@ -131,7 +128,7 @@ scoped_refptr<gfx::NativePixmap> SurfaceFactoryCast::CreateNativePixmap(
gfx::Size size,
gfx::BufferFormat format,
gfx::BufferUsage usage) {
return base::MakeRefCounted<CastPixmap>(egl_implementation_.get());
return base::MakeRefCounted<CastPixmap>();
}
} // namespace ui
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