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 "content/public/test/test_synchronous_compositor_android.h"
7 #include "cc/output/compositor_frame.h"
11 TestSynchronousCompositor::TestSynchronousCompositor() : client_(NULL
) {
14 TestSynchronousCompositor::~TestSynchronousCompositor() {
18 void TestSynchronousCompositor::SetClient(SynchronousCompositorClient
* client
) {
20 client_
->DidDestroyCompositor(this);
23 client_
->DidInitializeCompositor(this);
26 scoped_ptr
<cc::CompositorFrame
> TestSynchronousCompositor::DemandDrawHw(
27 gfx::Size surface_size
,
28 const gfx::Transform
& transform
,
31 gfx::Rect viewport_rect_for_tile_priority
,
32 const gfx::Transform
& transform_for_tile_priority
) {
33 scoped_ptr
<cc::CompositorFrame
> compositor_frame(new cc::CompositorFrame
);
34 scoped_ptr
<cc::DelegatedFrameData
> frame(new cc::DelegatedFrameData
);
35 scoped_ptr
<cc::RenderPass
> root_pass(cc::RenderPass::Create());
36 root_pass
->SetNew(cc::RenderPassId(1, 1), viewport
, viewport
,
38 frame
->render_pass_list
.push_back(root_pass
.Pass());
39 compositor_frame
->delegated_frame_data
= frame
.Pass();
40 return compositor_frame
.Pass();
43 bool TestSynchronousCompositor::DemandDrawSw(SkCanvas
* canvas
) {
48 } // namespace content