Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(531)

Unified Diff: services/ui/surfaces/direct_output_surface_ozone.cc

Issue 2399983003: cc: Make OutputSurface::Reshape abstract (Closed)
Patch Set: reshapeabstract: . Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: services/ui/surfaces/direct_output_surface_ozone.cc
diff --git a/services/ui/surfaces/direct_output_surface_ozone.cc b/services/ui/surfaces/direct_output_surface_ozone.cc
index 8e723c6d83ea32a3f9e00368d543bf190292cb57..eb37ad78ede24dda71c3be57c5507bca5b508255 100644
--- a/services/ui/surfaces/direct_output_surface_ozone.cc
+++ b/services/ui/surfaces/direct_output_surface_ozone.cc
@@ -83,6 +83,22 @@ void DirectOutputSurfaceOzone::BindFramebuffer() {
buffer_queue_->BindFramebuffer();
}
+// We call this on every frame that a value changes, but changing the size once
+// we've allocated backing NativePixmapOzone instances will cause a DCHECK
+// because Chrome never Reshape(s) after the first one from (0,0). NB: this
+// implies that screen size changes need to be plumbed differently. In
+// particular, we must create the native window in the size that the hardware
+// reports.
+void DirectOutputSurfaceOzone::Reshape(const gfx::Size& size,
+ float device_scale_factor,
+ const gfx::ColorSpace& color_space,
+ bool has_alpha) {
+ reshape_size_ = size;
+ context_provider()->ContextGL()->ResizeCHROMIUM(
+ size.width(), size.height(), device_scale_factor, has_alpha);
+ buffer_queue_->Reshape(size, device_scale_factor, color_space);
+}
+
void DirectOutputSurfaceOzone::SwapBuffers(cc::OutputSurfaceFrame frame) {
DCHECK(buffer_queue_);
@@ -113,20 +129,6 @@ uint32_t DirectOutputSurfaceOzone::GetFramebufferCopyTextureFormat() {
return buffer_queue_->internal_format();
}
-// We call this on every frame but changing the size once we've allocated
-// backing NativePixmapOzone instances will cause a DCHECK because
-// Chrome never Reshape(s) after the first one from (0,0). NB: this implies
-// that screen size changes need to be plumbed differently. In particular, we
-// must create the native window in the size that the hardware reports.
-void DirectOutputSurfaceOzone::Reshape(const gfx::Size& size,
- float scale_factor,
- const gfx::ColorSpace& color_space,
- bool alpha) {
- reshape_size_ = size;
- OutputSurface::Reshape(size, scale_factor, color_space, alpha);
- buffer_queue_->Reshape(size, scale_factor, color_space);
-}
-
cc::OverlayCandidateValidator*
DirectOutputSurfaceOzone::GetOverlayCandidateValidator() const {
return nullptr;
« no previous file with comments | « services/ui/surfaces/direct_output_surface_ozone.h ('k') | ui/compositor/test/in_process_context_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698