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

Side by Side Diff: components/mus/surfaces/direct_output_surface.cc

Issue 2096493002: Make cc::CompositorFrames movable [Part 1 of 2] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix reflector Created 4 years, 6 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "components/mus/surfaces/direct_output_surface.h" 5 #include "components/mus/surfaces/direct_output_surface.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
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 30 matching lines...) Expand all
41 41
42 void DirectOutputSurface::OnVSyncParametersUpdated( 42 void DirectOutputSurface::OnVSyncParametersUpdated(
43 const base::TimeTicks& timebase, 43 const base::TimeTicks& timebase,
44 const base::TimeDelta& interval) { 44 const base::TimeDelta& interval) {
45 // TODO(brianderson): We should not be receiving 0 intervals. 45 // TODO(brianderson): We should not be receiving 0 intervals.
46 synthetic_begin_frame_source_->OnUpdateVSyncParameters( 46 synthetic_begin_frame_source_->OnUpdateVSyncParameters(
47 timebase, 47 timebase,
48 interval.is_zero() ? cc::BeginFrameArgs::DefaultInterval() : interval); 48 interval.is_zero() ? cc::BeginFrameArgs::DefaultInterval() : interval);
49 } 49 }
50 50
51 void DirectOutputSurface::SwapBuffers(cc::CompositorFrame* frame) { 51 void DirectOutputSurface::SwapBuffers(
52 std::unique_ptr<cc::CompositorFrame> frame) {
52 DCHECK(context_provider_); 53 DCHECK(context_provider_);
53 DCHECK(frame->gl_frame_data); 54 DCHECK(frame->gl_frame_data);
54 if (frame->gl_frame_data->sub_buffer_rect == 55 if (frame->gl_frame_data->sub_buffer_rect ==
55 gfx::Rect(frame->gl_frame_data->size)) { 56 gfx::Rect(frame->gl_frame_data->size)) {
56 context_provider_->ContextSupport()->Swap(); 57 context_provider_->ContextSupport()->Swap();
57 } else { 58 } else {
58 context_provider_->ContextSupport()->PartialSwapBuffers( 59 context_provider_->ContextSupport()->PartialSwapBuffers(
59 frame->gl_frame_data->sub_buffer_rect); 60 frame->gl_frame_data->sub_buffer_rect);
60 } 61 }
61 62
(...skipping 10 matching lines...) Expand all
72 client_->DidSwapBuffers(); 73 client_->DidSwapBuffers();
73 } 74 }
74 75
75 uint32_t DirectOutputSurface::GetFramebufferCopyTextureFormat() { 76 uint32_t DirectOutputSurface::GetFramebufferCopyTextureFormat() {
76 // TODO(danakj): What attributes are used for the default framebuffer here? 77 // TODO(danakj): What attributes are used for the default framebuffer here?
77 // Can it have alpha? SurfacesContextProvider doesn't take any attributes. 78 // Can it have alpha? SurfacesContextProvider doesn't take any attributes.
78 return GL_RGB; 79 return GL_RGB;
79 } 80 }
80 81
81 } // namespace mus 82 } // namespace mus
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698