tuple: update to make use of C++11
[chromium-blink-merge.git] / content / public / test / test_synchronous_compositor_android.cc
blob27ed1243961debf150f9f65ac532f761bca93b29
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()
12 : client_(NULL), hardware_initialized_(false) {
15 TestSynchronousCompositor::~TestSynchronousCompositor() {
16 DCHECK(!hardware_initialized_);
17 SetClient(NULL);
20 void TestSynchronousCompositor::SetClient(SynchronousCompositorClient* client) {
21 if (client_)
22 client_->DidDestroyCompositor(this);
23 client_ = client;
24 if (client_)
25 client_->DidInitializeCompositor(this);
28 bool TestSynchronousCompositor::InitializeHwDraw() {
29 DCHECK(!hardware_initialized_);
30 hardware_initialized_ = true;
31 return true;
34 void TestSynchronousCompositor::ReleaseHwDraw() {
35 DCHECK(hardware_initialized_);
36 hardware_initialized_ = false;
39 scoped_ptr<cc::CompositorFrame> TestSynchronousCompositor::DemandDrawHw(
40 gfx::Size surface_size,
41 const gfx::Transform& transform,
42 gfx::Rect viewport,
43 gfx::Rect clip,
44 gfx::Rect viewport_rect_for_tile_priority,
45 const gfx::Transform& transform_for_tile_priority) {
46 DCHECK(hardware_initialized_);
47 return nullptr;
50 void TestSynchronousCompositor::ReturnResources(
51 const cc::CompositorFrameAck& frame_ack) {
52 DCHECK(hardware_initialized_);
55 bool TestSynchronousCompositor::DemandDrawSw(SkCanvas* canvas) {
56 DCHECK(canvas);
57 return true;
60 void TestSynchronousCompositor::SetMemoryPolicy(size_t bytes_limit) {
61 DCHECK(!bytes_limit || hardware_initialized_) << bytes_limit;
64 } // namespace content