blob: 41c46e06ee72ccc5f57ecc83b39116d2a0ad9e1d [file] [log] [blame]
#pragma once
/*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <memory>
#include "common/vsoc/lib/typed_region_view.h"
#include "common/vsoc/shm/framebuffer_layout.h"
namespace vsoc {
namespace framebuffer {
/* Grants access to the framebuffer region. It only knows about the available
* buffer space, but not about the distribution of that space, it's up to the
* gralloc hal to break it into different buffers.
* This region is temporary since the framebuffer should be integrated into the
* gralloc buffers region.*/
class FrameBufferRegionView
: public vsoc::TypedRegionView<
FrameBufferRegionView,
vsoc::layout::framebuffer::FrameBufferLayout> {
public:
size_t total_buffer_size() const;
uint32_t first_buffer_offset() const;
// Gets a pointer to an offset of the region.
void* GetBufferFromOffset(uint32_t offset);
};
} // namespace framebuffer
} // namespace vsoc