chromium/cc/resources/ui_resource_manager.h

// Copyright 2016 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CC_RESOURCES_UI_RESOURCE_MANAGER_H_
#define CC_RESOURCES_UI_RESOURCE_MANAGER_H_

#include <memory>
#include <unordered_map>
#include <vector>

#include "base/containers/flat_map.h"
#include "base/memory/raw_ptr.h"
#include "cc/cc_export.h"
#include "cc/resources/ui_resource_request.h"

namespace cc {
class ScopedUIResource;

// UIResourceManager creates and manages UIResourceBitmaps and UIResourceIDs
// for given bitmaps for a LayerTreeHost. There are two ways to use the
// interface:
//  1. `CreateUIResource`/`DeleteUIResource` to explicitly manage the lifetime
//     of UIResources.
//  2. `GetOrCreateUIResource` to create shared UIResources backed by the same
//     SkBitmap (SkPixelRef to be exact). The created UIResources are owned by
//     the manager and are released when all references outside the manager's
//     map are dropped.
class CC_EXPORT UIResourceManager {};

}  // namespace cc

#endif  // CC_RESOURCES_UI_RESOURCE_MANAGER_H_