#include "remoting/client/display/gl_canvas.h"
#include "base/check.h"
#include "remoting/client/display/gl_helpers.h"
#include "remoting/client/display/gl_math.h"
namespace {
const int kVertexSize = …;
const int kVertexCount = …;
const char kTexCoordToViewVert[] = …
"varying vec2 v_texCoord;\n"
"attribute vec2 a_texCoord;\n"
"attribute vec2 a_position;\n"
"uniform mat3 u_transform;\n"
"uniform vec2 u_viewSize;\n"
"const mat3 tex_to_view = mat3(2, 0, 0,\n"
" 0, -2, 0,\n"
" -1, 1, 0);\n"
"void main() {\n"
" v_texCoord = a_texCoord;\n"
" vec3 trans_position = u_transform * vec3(a_position, 1.0);\n"
" trans_position.xy /= u_viewSize;\n"
" gl_Position = vec4(tex_to_view * trans_position, 1.0);\n"
"}";
const char kDrawTexFrag[] = …;
}
namespace remoting {
GlCanvas::GlCanvas(int gl_version) : … { … }
GlCanvas::~GlCanvas() { … }
void GlCanvas::Clear() { … }
void GlCanvas::SetTransformationMatrix(const std::array<float, 9>& matrix) { … }
void GlCanvas::SetViewSize(int width, int height) { … }
void GlCanvas::DrawTexture(int texture_id,
int texture_handle,
int vertex_buffer,
float alpha_multiplier) { … }
int GlCanvas::GetVersion() const { … }
int GlCanvas::GetMaxTextureSize() const { … }
base::WeakPtr<Canvas> GlCanvas::GetWeakPtr() { … }
}