mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
This CL goes from this: //mojo/services/public/cpp/surfaces //mojo/services/public/interfaces/surfaces to this: //mojo/services/surfaces/public/cpp //mojo/services/surfaces/public/interfaces This CL also makes the Mojo-side changes required to roll this change into Chromium. TBR=beng Review URL: https://codereview.chromium.org/792813002
46 lines
1.1 KiB
C++
46 lines
1.1 KiB
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.
|
|
|
|
#ifndef SKY_COMPOSITOR_RESOURCE_MANAGER_H_
|
|
#define SKY_COMPOSITOR_RESOURCE_MANAGER_H_
|
|
|
|
#include "base/containers/hash_tables.h"
|
|
#include "base/memory/weak_ptr.h"
|
|
#include "mojo/services/surfaces/public/interfaces/surfaces.mojom.h"
|
|
|
|
namespace gfx {
|
|
class Size;
|
|
}
|
|
|
|
namespace mojo {
|
|
class GLContext;
|
|
class GLTexture;
|
|
}
|
|
|
|
namespace sky {
|
|
class Layer;
|
|
class LayerHost;
|
|
|
|
class ResourceManager {
|
|
public:
|
|
explicit ResourceManager(base::WeakPtr<mojo::GLContext> gl_context);
|
|
~ResourceManager();
|
|
|
|
scoped_ptr<mojo::GLTexture> CreateTexture(const gfx::Size& size);
|
|
|
|
mojo::TransferableResourcePtr CreateTransferableResource(Layer* layer);
|
|
void ReturnResources(mojo::Array<mojo::ReturnedResourcePtr> resources);
|
|
|
|
private:
|
|
base::WeakPtr<mojo::GLContext> gl_context_;
|
|
uint32_t next_resource_id_;
|
|
base::hash_map<uint32_t, mojo::GLTexture*> resource_to_texture_map_;
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(ResourceManager);
|
|
};
|
|
|
|
} // namespace examples
|
|
|
|
#endif // SKY_COMPOSITOR_RESOURCE_MANAGER_H_
|