Revert of ui: Clean up damaged rects and clear them after painting. (patchset #2...
[chromium-blink-merge.git] / android_webview / browser / parent_output_surface.cc
blob0680bc72e4456ca6b25d5b1fbb788d6be42fccab
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.
5 #include "android_webview/browser/parent_output_surface.h"
7 #include "cc/output/output_surface_client.h"
8 #include "gpu/command_buffer/client/gles2_interface.h"
10 namespace android_webview {
12 ParentOutputSurface::ParentOutputSurface(
13 scoped_refptr<cc::ContextProvider> context_provider)
14 : cc::OutputSurface(context_provider) {
15 capabilities_.draw_and_swap_full_viewport_every_frame = true;
18 ParentOutputSurface::~ParentOutputSurface() {
21 void ParentOutputSurface::SwapBuffers(cc::CompositorFrame* frame) {
22 context_provider_->ContextGL()->ShallowFlushCHROMIUM();
23 client_->DidSwapBuffers();
26 void ParentOutputSurface::SetDrawConstraints(const gfx::Size& surface_size,
27 const gfx::Rect& clip) {
28 DCHECK(client_);
29 surface_size_ = surface_size;
30 const gfx::Transform identity;
31 const gfx::Rect empty;
32 const bool resourceless_software_draw = false;
33 SetExternalDrawConstraints(
34 identity, empty, clip, clip, identity, resourceless_software_draw);
37 } // namespace android_webview