blob: ab114e3a727687b74fec65309331e2d1c2870209 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
// Copyright (c) 2010 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 GPU_PGL_COMMAND_BUFFER_PEPPER_H
#define GPU_PGL_COMMAND_BUFFER_PEPPER_H
#include "gpu/command_buffer/common/command_buffer.h"
#include "third_party/npapi/bindings/npapi.h"
#include "third_party/npapi/bindings/npruntime.h"
#include "webkit/glue/plugins/nphostapi.h"
// A CommandBuffer proxy implementation that uses the Pepper API to access
// the command buffer.
class CommandBufferPepper : public gpu::CommandBuffer {
public:
CommandBufferPepper(NPP npp,
NPDevice* device,
NPDeviceContext3D* device_context);
virtual ~CommandBufferPepper();
// CommandBuffer implementation.
virtual bool Initialize(int32 size);
virtual gpu::Buffer GetRingBuffer();
virtual int32 GetSize();
virtual int32 SyncOffsets(int32 put_offset);
virtual int32 GetGetOffset();
virtual void SetGetOffset(int32 get_offset);
virtual int32 GetPutOffset();
virtual int32 CreateTransferBuffer(size_t size);
virtual void DestroyTransferBuffer(int32 id);
virtual gpu::Buffer GetTransferBuffer(int32 handle);
virtual int32 GetToken();
virtual void SetToken(int32 token);
virtual int32 ResetParseError();
virtual void SetParseError(int32 parse_error);
virtual bool GetErrorStatus();
virtual void RaiseErrorStatus();
private:
NPP npp_;
NPDevice* device_;
NPDeviceContext3D* context_;
};
#endif // GPU_PGL_COMMAND_BUFFER_PEPPER_H
|