chromium/gpu/command_buffer/client/client_test_helper.cc

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

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/40285824): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

// Tests for GLES2Implementation.

#include "gpu/command_buffer/client/client_test_helper.h"

#include <stddef.h>
#include <stdint.h>

#include <memory>

#include "gpu/command_buffer/client/cmd_buffer_helper.h"
#include "gpu/command_buffer/common/command_buffer.h"
#include "testing/gmock/include/gmock/gmock.h"

_;
Invoke;

namespace gpu {

FakeCommandBufferServiceBase::FakeCommandBufferServiceBase() = default;

FakeCommandBufferServiceBase::~FakeCommandBufferServiceBase() = default;

CommandBuffer::State FakeCommandBufferServiceBase::GetState() {}

void FakeCommandBufferServiceBase::SetReleaseCount(uint64_t release_count) {}

// Get's the Id of the next transfer buffer that will be returned
// by CreateTransferBuffer. This is useful for testing expected ids.
int32_t FakeCommandBufferServiceBase::GetNextFreeTransferBufferId() {}

void FakeCommandBufferServiceBase::SetGetBufferHelper(int transfer_buffer_id,
                                                      int32_t token) {}

scoped_refptr<gpu::Buffer>
FakeCommandBufferServiceBase::CreateTransferBufferHelper(uint32_t size,
                                                         int32_t* id) {}

void FakeCommandBufferServiceBase::DestroyTransferBufferHelper(int32_t id) {}

scoped_refptr<Buffer> FakeCommandBufferServiceBase::GetTransferBuffer(
    int32_t id) {}

void FakeCommandBufferServiceBase::FlushHelper(int32_t put_offset) {}

void FakeCommandBufferServiceBase::SetToken(int32_t token) {}

void FakeCommandBufferServiceBase::SetParseError(error::Error error) {}

void FakeCommandBufferServiceBase::SetContextLostReason(
    error::ContextLostReason reason) {}

const int32_t FakeCommandBufferServiceBase::kTransferBufferBaseId;
const int32_t FakeCommandBufferServiceBase::kMaxTransferBuffers;

MockClientCommandBuffer::MockClientCommandBuffer() {}

MockClientCommandBuffer::~MockClientCommandBuffer() = default;

CommandBuffer::State MockClientCommandBuffer::GetLastState() {}

CommandBuffer::State MockClientCommandBuffer::WaitForTokenInRange(int32_t start,
                                                                  int32_t end) {}

CommandBuffer::State MockClientCommandBuffer::WaitForGetOffsetInRange(
    uint32_t set_get_buffer_count,
    int32_t start,
    int32_t end) {}

void MockClientCommandBuffer::SetGetBuffer(int transfer_buffer_id) {}

scoped_refptr<gpu::Buffer> MockClientCommandBuffer::CreateTransferBuffer(
    uint32_t size,
    int32_t* id,
    uint32_t alignment,
    TransferBufferAllocationOption option) {}

void MockClientCommandBuffer::Flush(int32_t put_offset) {}

void MockClientCommandBuffer::OrderingBarrier(int32_t put_offset) {}

void MockClientCommandBuffer::DelegateToFake() {}

void MockClientCommandBuffer::ForceLostContext(
    error::ContextLostReason reason) {}

MockClientCommandBufferMockFlush::MockClientCommandBufferMockFlush() {}

MockClientCommandBufferMockFlush::~MockClientCommandBufferMockFlush() = default;

void MockClientCommandBufferMockFlush::DelegateToFake() {}

void MockClientCommandBufferMockFlush::DoFlush(int32_t put_offset) {}

MockClientGpuControl::MockClientGpuControl() = default;

MockClientGpuControl::~MockClientGpuControl() = default;

FakeDecoderClient::~FakeDecoderClient() = default;
void FakeDecoderClient::OnConsoleMessage(int32_t, const std::string&) {}
void FakeDecoderClient::CacheBlob(gpu::GpuDiskCacheType,
                                  const std::string&,
                                  const std::string&) {}
void FakeDecoderClient::OnFenceSyncRelease(uint64_t) {}
void FakeDecoderClient::OnDescheduleUntilFinished() {}
void FakeDecoderClient::OnRescheduleAfterFinished() {}
void FakeDecoderClient::OnSwapBuffers(uint64_t, uint32_t) {}
void FakeDecoderClient::ScheduleGrContextCleanup() {}
void FakeDecoderClient::SetActiveURL(GURL) {}
void FakeDecoderClient::HandleReturnData(base::span<const uint8_t>) {}
bool FakeDecoderClient::ShouldYield() {}

}  // namespace gpu