flutter_flutter/viewer/compositor/surface_allocator.cc
Adam Barth ce5baf1e9d Move //sky/compositor to //sky/viewer/compositor
This library is logically part of //sky/viewer and shouldn't clutter up the
top-level //sky directory.

TBR=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1213683004.
2015-06-27 00:26:52 -07:00

27 lines
639 B
C++

// Copyright 2014 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 "sky/viewer/compositor/surface_allocator.h"
#include "base/logging.h"
namespace sky {
SurfaceAllocator::SurfaceAllocator(uint32_t id_namespace)
: id_namespace_(id_namespace), next_id_(1) {
DCHECK(id_namespace);
}
SurfaceAllocator::~SurfaceAllocator() {
}
mojo::SurfaceIdPtr SurfaceAllocator::CreateSurfaceId() {
auto id = mojo::SurfaceId::New();
id->local = next_id_++;
id->id_namespace = id_namespace_;
return id.Pass();
}
} // namespace sky