Hash :
876429b7
Author :
Date :
2017-04-20T15:46:24
Update gl2.h and update entry points. Some method signatures were updated. Types like GLclampf and GLvoid were replaced with other equivalents. BUG=angleproject:1309 Change-Id: I05e8e2072c5a063d87ad96a855b907424661e680 Reviewed-on: https://chromium-review.googlesource.com/475011 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
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 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371
//
// Copyright 2016 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// ContextNULL.cpp:
// Implements the class methods for ContextNULL.
//
#include "libANGLE/renderer/null/ContextNULL.h"
#include "common/debug.h"
#include "libANGLE/renderer/null/BufferNULL.h"
#include "libANGLE/renderer/null/CompilerNULL.h"
#include "libANGLE/renderer/null/DisplayNULL.h"
#include "libANGLE/renderer/null/FenceNVNULL.h"
#include "libANGLE/renderer/null/FenceSyncNULL.h"
#include "libANGLE/renderer/null/FramebufferNULL.h"
#include "libANGLE/renderer/null/ImageNULL.h"
#include "libANGLE/renderer/null/PathNULL.h"
#include "libANGLE/renderer/null/ProgramNULL.h"
#include "libANGLE/renderer/null/QueryNULL.h"
#include "libANGLE/renderer/null/RenderbufferNULL.h"
#include "libANGLE/renderer/null/SamplerNULL.h"
#include "libANGLE/renderer/null/ShaderNULL.h"
#include "libANGLE/renderer/null/TextureNULL.h"
#include "libANGLE/renderer/null/TransformFeedbackNULL.h"
#include "libANGLE/renderer/null/VertexArrayNULL.h"
namespace rx
{
AllocationTrackerNULL::AllocationTrackerNULL(size_t maxTotalAllocationSize)
: mAllocatedBytes(0), mMaxBytes(maxTotalAllocationSize)
{
}
AllocationTrackerNULL::~AllocationTrackerNULL()
{
// ASSERT that all objects with the NULL renderer clean up after themselves
ASSERT(mAllocatedBytes == 0);
}
bool AllocationTrackerNULL::updateMemoryAllocation(size_t oldSize, size_t newSize)
{
ASSERT(mAllocatedBytes >= oldSize);
size_t sizeAfterRelease = mAllocatedBytes - oldSize;
size_t sizeAfterReallocate = sizeAfterRelease + newSize;
if (sizeAfterReallocate < sizeAfterRelease || sizeAfterReallocate > mMaxBytes)
{
// Overflow or allocation would be too large
return false;
}
mAllocatedBytes = sizeAfterReallocate;
return true;
}
ContextNULL::ContextNULL(const gl::ContextState &state, AllocationTrackerNULL *allocationTracker)
: ContextImpl(state), mAllocationTracker(allocationTracker)
{
ASSERT(mAllocationTracker != nullptr);
const gl::Version maxClientVersion(3, 1);
mCaps = GenerateMinimumCaps(maxClientVersion);
mExtensions = gl::Extensions();
mExtensions.copyTexture = true;
mExtensions.copyCompressedTexture = true;
mTextureCaps = GenerateMinimumTextureCapsMap(maxClientVersion, mExtensions);
}
ContextNULL::~ContextNULL()
{
}
gl::Error ContextNULL::initialize()
{
return gl::NoError();
}
gl::Error ContextNULL::flush()
{
return gl::NoError();
}
gl::Error ContextNULL::finish()
{
return gl::NoError();
}
gl::Error ContextNULL::drawArrays(GLenum mode, GLint first, GLsizei count)
{
return gl::NoError();
}
gl::Error ContextNULL::drawArraysInstanced(GLenum mode,
GLint first,
GLsizei count,
GLsizei instanceCount)
{
return gl::NoError();
}
gl::Error ContextNULL::drawElements(GLenum mode,
GLsizei count,
GLenum type,
const void *indices,
const gl::IndexRange &indexRange)
{
return gl::NoError();
}
gl::Error ContextNULL::drawElementsInstanced(GLenum mode,
GLsizei count,
GLenum type,
const void *indices,
GLsizei instances,
const gl::IndexRange &indexRange)
{
return gl::NoError();
}
gl::Error ContextNULL::drawRangeElements(GLenum mode,
GLuint start,
GLuint end,
GLsizei count,
GLenum type,
const void *indices,
const gl::IndexRange &indexRange)
{
return gl::NoError();
}
gl::Error ContextNULL::drawArraysIndirect(GLenum mode, const void *indirect)
{
return gl::NoError();
}
gl::Error ContextNULL::drawElementsIndirect(GLenum mode, GLenum type, const void *indirect)
{
return gl::NoError();
}
void ContextNULL::stencilFillPath(const gl::Path *path, GLenum fillMode, GLuint mask)
{
}
void ContextNULL::stencilStrokePath(const gl::Path *path, GLint reference, GLuint mask)
{
}
void ContextNULL::coverFillPath(const gl::Path *path, GLenum coverMode)
{
}
void ContextNULL::coverStrokePath(const gl::Path *path, GLenum coverMode)
{
}
void ContextNULL::stencilThenCoverFillPath(const gl::Path *path,
GLenum fillMode,
GLuint mask,
GLenum coverMode)
{
}
void ContextNULL::stencilThenCoverStrokePath(const gl::Path *path,
GLint reference,
GLuint mask,
GLenum coverMode)
{
}
void ContextNULL::coverFillPathInstanced(const std::vector<gl::Path *> &paths,
GLenum coverMode,
GLenum transformType,
const GLfloat *transformValues)
{
}
void ContextNULL::coverStrokePathInstanced(const std::vector<gl::Path *> &paths,
GLenum coverMode,
GLenum transformType,
const GLfloat *transformValues)
{
}
void ContextNULL::stencilFillPathInstanced(const std::vector<gl::Path *> &paths,
GLenum fillMode,
GLuint mask,
GLenum transformType,
const GLfloat *transformValues)
{
}
void ContextNULL::stencilStrokePathInstanced(const std::vector<gl::Path *> &paths,
GLint reference,
GLuint mask,
GLenum transformType,
const GLfloat *transformValues)
{
}
void ContextNULL::stencilThenCoverFillPathInstanced(const std::vector<gl::Path *> &paths,
GLenum coverMode,
GLenum fillMode,
GLuint mask,
GLenum transformType,
const GLfloat *transformValues)
{
}
void ContextNULL::stencilThenCoverStrokePathInstanced(const std::vector<gl::Path *> &paths,
GLenum coverMode,
GLint reference,
GLuint mask,
GLenum transformType,
const GLfloat *transformValues)
{
}
GLenum ContextNULL::getResetStatus()
{
return GL_NO_ERROR;
}
std::string ContextNULL::getVendorString() const
{
return "NULL";
}
std::string ContextNULL::getRendererDescription() const
{
return "NULL";
}
void ContextNULL::insertEventMarker(GLsizei length, const char *marker)
{
}
void ContextNULL::pushGroupMarker(GLsizei length, const char *marker)
{
}
void ContextNULL::popGroupMarker()
{
}
void ContextNULL::syncState(const gl::State::DirtyBits &dirtyBits)
{
}
GLint ContextNULL::getGPUDisjoint()
{
return 0;
}
GLint64 ContextNULL::getTimestamp()
{
return 0;
}
void ContextNULL::onMakeCurrent(const gl::ContextState &data)
{
}
const gl::Caps &ContextNULL::getNativeCaps() const
{
return mCaps;
}
const gl::TextureCapsMap &ContextNULL::getNativeTextureCaps() const
{
return mTextureCaps;
}
const gl::Extensions &ContextNULL::getNativeExtensions() const
{
return mExtensions;
}
const gl::Limitations &ContextNULL::getNativeLimitations() const
{
return mLimitations;
}
CompilerImpl *ContextNULL::createCompiler()
{
return new CompilerNULL();
}
ShaderImpl *ContextNULL::createShader(const gl::ShaderState &data)
{
return new ShaderNULL(data);
}
ProgramImpl *ContextNULL::createProgram(const gl::ProgramState &data)
{
return new ProgramNULL(data);
}
FramebufferImpl *ContextNULL::createFramebuffer(const gl::FramebufferState &data)
{
return new FramebufferNULL(data);
}
TextureImpl *ContextNULL::createTexture(const gl::TextureState &state)
{
return new TextureNULL(state);
}
RenderbufferImpl *ContextNULL::createRenderbuffer()
{
return new RenderbufferNULL();
}
BufferImpl *ContextNULL::createBuffer(const gl::BufferState &state)
{
return new BufferNULL(state, mAllocationTracker);
}
VertexArrayImpl *ContextNULL::createVertexArray(const gl::VertexArrayState &data)
{
return new VertexArrayNULL(data);
}
QueryImpl *ContextNULL::createQuery(GLenum type)
{
return new QueryNULL(type);
}
FenceNVImpl *ContextNULL::createFenceNV()
{
return new FenceNVNULL();
}
FenceSyncImpl *ContextNULL::createFenceSync()
{
return new FenceSyncNULL();
}
TransformFeedbackImpl *ContextNULL::createTransformFeedback(const gl::TransformFeedbackState &state)
{
return new TransformFeedbackNULL(state);
}
SamplerImpl *ContextNULL::createSampler()
{
return new SamplerNULL();
}
std::vector<PathImpl *> ContextNULL::createPaths(GLsizei range)
{
std::vector<PathImpl *> result(range);
for (GLsizei idx = 0; idx < range; idx++)
{
result[idx] = new PathNULL();
}
return result;
}
gl::Error ContextNULL::dispatchCompute(GLuint numGroupsX, GLuint numGroupsY, GLuint numGroupsZ)
{
return gl::NoError();
}
} // namespace rx