Update V8 to version 4.7.21.
[chromium-blink-merge.git] / cc / test / pixel_test_output_surface.cc
blobc5137393a7a64063c78e0fc8829056c3673a9277
1 // Copyright 2013 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 "cc/test/pixel_test_output_surface.h"
7 #include "cc/output/output_surface_client.h"
8 #include "ui/gfx/transform.h"
10 namespace cc {
12 PixelTestOutputSurface::PixelTestOutputSurface(
13 scoped_refptr<ContextProvider> context_provider,
14 scoped_refptr<ContextProvider> worker_context_provider,
15 bool flipped_output_surface)
16 : OutputSurface(context_provider, worker_context_provider),
17 external_stencil_test_(false) {
18 capabilities_.adjust_deadline_for_parent = false;
19 capabilities_.flipped_output_surface = flipped_output_surface;
22 PixelTestOutputSurface::PixelTestOutputSurface(
23 scoped_refptr<ContextProvider> context_provider,
24 bool flipped_output_surface)
25 : PixelTestOutputSurface(context_provider,
26 nullptr,
27 flipped_output_surface) {
30 PixelTestOutputSurface::PixelTestOutputSurface(
31 scoped_ptr<SoftwareOutputDevice> software_device)
32 : OutputSurface(software_device.Pass()), external_stencil_test_(false) {
35 void PixelTestOutputSurface::Reshape(const gfx::Size& size,
36 float scale_factor) {
37 gfx::Size expanded_size(size.width() + surface_expansion_size_.width(),
38 size.height() + surface_expansion_size_.height());
39 OutputSurface::Reshape(expanded_size, scale_factor);
42 bool PixelTestOutputSurface::HasExternalStencilTest() const {
43 return external_stencil_test_;
46 void PixelTestOutputSurface::SwapBuffers(CompositorFrame* frame) {
47 PostSwapBuffersComplete();
48 client_->DidSwapBuffers();
51 } // namespace cc