summaryrefslogtreecommitdiffstats
path: root/ppapi/proxy/ppb_gles_chromium_texture_mapping_proxy.cc
blob: b6e1b514b97c58d79157275eecbf3a5b598e6076 (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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
// Copyright (c) 2011 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.

#include "ppapi/proxy/ppb_gles_chromium_texture_mapping_proxy.h"

#include "gpu/command_buffer/client/gles2_implementation.h"
#include "ppapi/c/pp_errors.h"
#include "ppapi/c/pp_resource.h"
#include "ppapi/c/dev/ppb_gles_chromium_texture_mapping_dev.h"
#include "ppapi/proxy/plugin_dispatcher.h"
#include "ppapi/proxy/plugin_resource.h"
#include "ppapi/proxy/ppb_context_3d_proxy.h"

namespace pp {
namespace proxy {

namespace {

void* MapTexSubImage2DCHROMIUM(PP_Resource context_id,
                               GLenum target,
                               GLint level,
                               GLint xoffset,
                               GLint yoffset,
                               GLsizei width,
                               GLsizei height,
                               GLenum format,
                               GLenum type,
                               GLenum access) {
  Context3D* context = PluginResource::GetAs<Context3D>(context_id);
  return context->gles2_impl()->MapTexSubImage2DCHROMIUM(
      target, level, xoffset, yoffset, width, height, format, type, access);
}

void UnmapTexSubImage2DCHROMIUM(PP_Resource context_id, const void* mem) {
  Context3D* context = PluginResource::GetAs<Context3D>(context_id);
  context->gles2_impl()->UnmapTexSubImage2DCHROMIUM(mem);
}

const struct PPB_GLESChromiumTextureMapping_Dev gles2_chromium_tm_interface = {
  MapTexSubImage2DCHROMIUM,
  UnmapTexSubImage2DCHROMIUM
};

InterfaceProxy* CreateGLESChromiumTextureMappingProxy(
    Dispatcher* dispatcher,
    const void* target_interface) {
  return new PPB_GLESChromiumTextureMapping_Proxy(dispatcher, target_interface);
}

}  // namespace

PPB_GLESChromiumTextureMapping_Proxy::PPB_GLESChromiumTextureMapping_Proxy(
    Dispatcher* dispatcher,
    const void* target_interface)
    : InterfaceProxy(dispatcher, target_interface) {
}

PPB_GLESChromiumTextureMapping_Proxy::~PPB_GLESChromiumTextureMapping_Proxy() {
}

// static
const InterfaceProxy::Info* PPB_GLESChromiumTextureMapping_Proxy::GetInfo() {
  static const Info info = {
    &gles2_chromium_tm_interface,
    PPB_GLES_CHROMIUM_TEXTURE_MAPPING_DEV_INTERFACE,
    INTERFACE_ID_PPB_GLES_CHROMIUM_TM,
    false,
    &CreateGLESChromiumTextureMappingProxy,
  };
  return &info;
}

bool PPB_GLESChromiumTextureMapping_Proxy::OnMessageReceived(
    const IPC::Message& msg) {
  return false;
}

}  // namespace proxy
}  // namespace pp