summaryrefslogtreecommitdiffstats
path: root/components/exo/test/exo_test_helper.cc
blob: 84d580a8750afad0b854669b79d4766184d2823b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "components/exo/test/exo_test_helper.h"

#include "gpu/command_buffer/client/gpu_memory_buffer_manager.h"
#include "ui/aura/env.h"
#include "ui/compositor/compositor.h"

namespace exo {
namespace test {

////////////////////////////////////////////////////////////////////////////////
// ExoTestHelper, public:

ExoTestHelper::ExoTestHelper() {}

ExoTestHelper::~ExoTestHelper() {}

scoped_ptr<gfx::GpuMemoryBuffer> ExoTestHelper::CreateGpuMemoryBuffer(
    const gfx::Size& size) {
  return aura::Env::GetInstance()
      ->context_factory()
      ->GetGpuMemoryBufferManager()
      ->AllocateGpuMemoryBuffer(size, gfx::BufferFormat::RGBA_8888,
                                gfx::BufferUsage::GPU_READ);
}

}  // namespace test
}  // namespace exo