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

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

Issue 2699173002: cc: Make OutputSurfaceFrame::sub_buffer_rect optional (Closed)
Patch Set: 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 gfx::Rect damage(swap_size_);
87 if (frame.sub_buffer_rect) {
danakj 2017/02/22 00:36:57 no {}
88 damage = *frame.sub_buffer_rect;
89 }
90 buffer_queue_->SwapBuffers(damage);
danakj 2017/02/22 00:36:57 ?: maybe here also?
halliwell 2017/02/22 14:19:28 Done.
87 DisplayOutputSurface::SwapBuffers(std::move(frame)); 91 DisplayOutputSurface::SwapBuffers(std::move(frame));
88 } 92 }
89 93
90 uint32_t DisplayOutputSurfaceOzone::GetFramebufferCopyTextureFormat() { 94 uint32_t DisplayOutputSurfaceOzone::GetFramebufferCopyTextureFormat() {
91 return buffer_queue_->internal_format(); 95 return buffer_queue_->internal_format();
92 } 96 }
93 97
94 bool DisplayOutputSurfaceOzone::IsDisplayedAsOverlayPlane() const { 98 bool DisplayOutputSurfaceOzone::IsDisplayedAsOverlayPlane() const {
95 // TODO(rjkroege): implement remaining overlay functionality. 99 // TODO(rjkroege): implement remaining overlay functionality.
96 return true; 100 return true;
(...skipping 15 matching lines...) Expand all
112 } 116 }
113 117
114 buffer_queue_->PageFlipComplete(); 118 buffer_queue_->PageFlipComplete();
115 client()->DidReceiveSwapBuffersAck(); 119 client()->DidReceiveSwapBuffersAck();
116 120
117 if (force_swap) 121 if (force_swap)
118 client()->SetNeedsRedrawRect(gfx::Rect(swap_size_)); 122 client()->SetNeedsRedrawRect(gfx::Rect(swap_size_));
119 } 123 }
120 124
121 } // namespace ui 125 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698