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

Side by Side Diff: components/view_manager/surfaces/surfaces_output_surface.cc

Issue 1344573002: Mandoline: Rename components/view_manager to components/mus (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 5 years, 3 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "components/view_manager/surfaces/surfaces_output_surface.h"
6
7 #include "base/bind.h"
8 #include "cc/output/compositor_frame.h"
9 #include "cc/output/context_provider.h"
10 #include "cc/output/output_surface_client.h"
11 #include "gpu/command_buffer/client/context_support.h"
12 #include "gpu/command_buffer/client/gles2_interface.h"
13
14 namespace surfaces {
15
16 DirectOutputSurface::DirectOutputSurface(
17 const scoped_refptr<cc::ContextProvider>& context_provider)
18 : cc::OutputSurface(context_provider), weak_ptr_factory_(this) {
19 }
20
21 DirectOutputSurface::~DirectOutputSurface() {
22 }
23
24 void DirectOutputSurface::SwapBuffers(cc::CompositorFrame* frame) {
25 DCHECK(context_provider_.get());
26 DCHECK(frame->gl_frame_data);
27 if (frame->gl_frame_data->sub_buffer_rect ==
28 gfx::Rect(frame->gl_frame_data->size)) {
29 context_provider_->ContextSupport()->Swap();
30 } else {
31 context_provider_->ContextSupport()->PartialSwapBuffers(
32 frame->gl_frame_data->sub_buffer_rect);
33 }
34 uint32_t sync_point =
35 context_provider_->ContextGL()->InsertSyncPointCHROMIUM();
36 context_provider_->ContextSupport()->SignalSyncPoint(
37 sync_point, base::Bind(&OutputSurface::OnSwapBuffersComplete,
38 weak_ptr_factory_.GetWeakPtr()));
39 client_->DidSwapBuffers();
40 }
41
42 } // namespace surfaces
OLDNEW
« no previous file with comments | « components/view_manager/surfaces/surfaces_output_surface.h ('k') | components/view_manager/surfaces/surfaces_scheduler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698