blob: 0150eaa555598398cb56697c04c1038c877133c3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "android_webview/browser/parent_output_surface.h"
#include "cc/output/output_surface_client.h"
#include "gpu/command_buffer/client/gles2_interface.h"
namespace android_webview {
ParentOutputSurface::ParentOutputSurface(
scoped_refptr<cc::ContextProvider> context_provider)
: cc::OutputSurface(context_provider) {
capabilities_.draw_and_swap_full_viewport_every_frame = true;
}
ParentOutputSurface::~ParentOutputSurface() {
}
void ParentOutputSurface::SwapBuffers(cc::CompositorFrame* frame) {
context_provider_->ContextGL()->ShallowFlushCHROMIUM();
client_->DidSwapBuffers();
}
void ParentOutputSurface::SetDrawConstraints(const gfx::Size& surface_size,
const gfx::Rect& clip) {
DCHECK(client_);
surface_size_ = surface_size;
gfx::Transform identity;
gfx::Rect empty;
SetExternalDrawConstraints(identity, empty, clip, true);
}
} // namespace android_webview
|