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

Side by Side Diff: services/ui/surfaces/display_output_surface_ozone.cc

Issue 2699173002: cc: Make OutputSurfaceFrame::sub_buffer_rect optional (Closed)
Patch Set: Removed obsolete comment Created 3 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "services/ui/surfaces/display_output_surface_ozone.h" 5 #include "services/ui/surfaces/display_output_surface_ozone.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 } 76 }
77 77
78 void DisplayOutputSurfaceOzone::SwapBuffers(cc::OutputSurfaceFrame frame) { 78 void DisplayOutputSurfaceOzone::SwapBuffers(cc::OutputSurfaceFrame frame) {
79 DCHECK(buffer_queue_); 79 DCHECK(buffer_queue_);
80 80
81 // TODO(rjkroege): What if swap happens again before DidReceiveSwapBuffersAck 81 // TODO(rjkroege): What if swap happens again before DidReceiveSwapBuffersAck
82 // then it would see the wrong size? 82 // then it would see the wrong size?
83 DCHECK(reshape_size_ == frame.size); 83 DCHECK(reshape_size_ == frame.size);
84 swap_size_ = reshape_size_; 84 swap_size_ = reshape_size_;
85 85
86 buffer_queue_->SwapBuffers(frame.sub_buffer_rect); 86 buffer_queue_->SwapBuffers(frame.sub_buffer_rect ? *frame.sub_buffer_rect
87 : gfx::Rect(swap_size_));
87 DisplayOutputSurface::SwapBuffers(std::move(frame)); 88 DisplayOutputSurface::SwapBuffers(std::move(frame));
88 } 89 }
89 90
90 uint32_t DisplayOutputSurfaceOzone::GetFramebufferCopyTextureFormat() { 91 uint32_t DisplayOutputSurfaceOzone::GetFramebufferCopyTextureFormat() {
91 return buffer_queue_->internal_format(); 92 return buffer_queue_->internal_format();
92 } 93 }
93 94
94 bool DisplayOutputSurfaceOzone::IsDisplayedAsOverlayPlane() const { 95 bool DisplayOutputSurfaceOzone::IsDisplayedAsOverlayPlane() const {
95 // TODO(rjkroege): implement remaining overlay functionality. 96 // TODO(rjkroege): implement remaining overlay functionality.
96 return true; 97 return true;
(...skipping 15 matching lines...) Expand all
112 } 113 }
113 114
114 buffer_queue_->PageFlipComplete(); 115 buffer_queue_->PageFlipComplete();
115 client()->DidReceiveSwapBuffersAck(); 116 client()->DidReceiveSwapBuffersAck();
116 117
117 if (force_swap) 118 if (force_swap)
118 client()->SetNeedsRedrawRect(gfx::Rect(swap_size_)); 119 client()->SetNeedsRedrawRect(gfx::Rect(swap_size_));
119 } 120 }
120 121
121 } // namespace ui 122 } // namespace ui
OLDNEW
« no previous file with comments | « services/ui/surfaces/display_output_surface.cc ('k') | ui/compositor/test/in_process_context_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698