Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / blimp / client / compositor / blimp_output_surface.cc
blobdd4b89a92f9b44a88944ef4dcb14043440e67ea5
1 // Copyright 2015 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.
5 #include "blimp/client/compositor/blimp_output_surface.h"
7 #include "base/bind.h"
8 #include "base/message_loop/message_loop.h"
9 #include "cc/output/output_surface_client.h"
10 #include "gpu/command_buffer/client/context_support.h"
12 namespace blimp {
14 BlimpOutputSurface::BlimpOutputSurface(
15 const scoped_refptr<cc::ContextProvider>& context_provider)
16 : cc::OutputSurface(context_provider) {
17 capabilities_.max_frames_pending = 2;
20 BlimpOutputSurface::~BlimpOutputSurface() {}
22 void BlimpOutputSurface::SwapBuffers(cc::CompositorFrame* frame) {
23 // See cc::OutputSurface::SwapBuffers() comment for details.
24 context_provider_->ContextSupport()->Swap();
25 client_->DidSwapBuffers();
26 cc::OutputSurface::PostSwapBuffersComplete();
29 } // namespace blimp