Upstreaming browser/ui/uikit_ui_util from iOS.
[chromium-blink-merge.git] / content / public / test / test_synchronous_compositor_android.cc
blob155d397a09c84c78341f8bfe9dc3472c1e2255f2
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"
9 namespace content {
11 TestSynchronousCompositor::TestSynchronousCompositor() : client_(NULL) {
14 TestSynchronousCompositor::~TestSynchronousCompositor() {
15 SetClient(NULL);
18 void TestSynchronousCompositor::SetClient(SynchronousCompositorClient* client) {
19 if (client_)
20 client_->DidDestroyCompositor(this);
21 client_ = client;
22 if (client_)
23 client_->DidInitializeCompositor(this);
26 scoped_ptr<cc::CompositorFrame> TestSynchronousCompositor::DemandDrawHw(
27 gfx::Size surface_size,
28 const gfx::Transform& transform,
29 gfx::Rect viewport,
30 gfx::Rect clip,
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,
37 gfx::Transform());
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) {
44 DCHECK(canvas);
45 return true;
48 } // namespace content