summaryrefslogtreecommitdiff
path: root/chromium/ui/gl/gl_image.cc
blob: 768a48f66a6ee5663f7508bb02340e2b9c415c62 (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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
// Copyright 2016 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 "ui/gl/gl_image.h"

#include "ui/gl/gl_bindings.h"

#if defined(OS_ANDROID)
#include "base/android/scoped_hardware_buffer_fence_sync.h"
#endif

namespace gl {

gfx::Size GLImage::GetSize() {
  NOTREACHED();
  return gfx::Size();
}

unsigned GLImage::GetInternalFormat() {
  NOTREACHED();
  return GL_NONE;
}

unsigned GLImage::GetDataFormat() {
  // GetInternalFormat() mostly returns unsized format and can be used both
  // as internal format and data format. However, GL_EXT_texture_norm16
  // follows ES3 semantics and only exposes a sized internalformat.
  unsigned internalformat = GetInternalFormat();
  switch (internalformat) {
    case GL_R16_EXT:
      return GL_RED;
    case GL_RGB10_A2_EXT:
      return GL_RGBA;
    case GL_RGB_YCRCB_420_CHROMIUM:
    case GL_RGB_YCBCR_420V_CHROMIUM:
    case GL_RGB_YCBCR_P010_CHROMIUM:
      return GL_RGB;
    case GL_RED:
    case GL_RG:
    case GL_RGB:
    case GL_RGBA:
    case GL_BGRA_EXT:
      return internalformat;
    default:
      NOTREACHED();
      return GL_NONE;
  }
}

unsigned GLImage::GetDataType() {
  NOTREACHED();
  return GL_NONE;
}

GLImage::BindOrCopy GLImage::ShouldBindOrCopy() {
  NOTREACHED();
  return BIND;
}

bool GLImage::BindTexImage(unsigned target) {
  NOTREACHED();
  return false;
}

bool GLImage::BindTexImageWithInternalformat(unsigned target,
                                             unsigned internalformat) {
  NOTREACHED();
  return false;
}

void GLImage::ReleaseTexImage(unsigned target) {
  NOTREACHED();
}

bool GLImage::CopyTexImage(unsigned target) {
  NOTREACHED();
  return false;
}

bool GLImage::CopyTexSubImage(unsigned target,
                              const gfx::Point& offset,
                              const gfx::Rect& rect) {
  NOTREACHED();
  return false;
}

bool GLImage::ScheduleOverlayPlane(gfx::AcceleratedWidget widget,
                                   int z_order,
                                   gfx::OverlayTransform transform,
                                   const gfx::Rect& bounds_rect,
                                   const gfx::RectF& crop_rect,
                                   bool enable_blend,
                                   std::unique_ptr<gfx::GpuFence> gpu_fence) {
  NOTREACHED();
  return false;
}

void GLImage::SetColorSpace(const gfx::ColorSpace& color_space) {
  color_space_ = color_space;
}

void GLImage::Flush() {
  NOTREACHED();
}

void GLImage::OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd,
                           uint64_t process_tracing_id,
                           const std::string& dump_name) {
  NOTREACHED();
}

bool GLImage::EmulatingRGB() const {
  return false;
}

bool GLImage::IsInUseByWindowServer() const {
  return false;
}

void GLImage::DisableInUseByWindowServer() {
  NOTIMPLEMENTED();
}

GLImage::Type GLImage::GetType() const {
  return Type::NONE;
}

#if defined(OS_ANDROID)
std::unique_ptr<base::android::ScopedHardwareBufferFenceSync>
GLImage::GetAHardwareBuffer() {
  return nullptr;
}
#endif

bool GLImage::HasMutableState() const {
  return true;
}

scoped_refptr<gfx::NativePixmap> GLImage::GetNativePixmap() {
  return nullptr;
}

}  // namespace gl