Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(227)

Side by Side Diff: third_party/WebKit/Source/modules/webgl/OESVertexArrayObject.cpp

Issue 2547813002: Remove WebGLObject maps from WebGLRenderingContextBase and WebGLContextGroup. (Closed)
Patch Set: Fixed WebGLContextObject::validate. Made WebGLExtension non-finalized. Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 20 matching lines...) Expand all
31 #include "modules/webgl/WebGLVertexArrayObjectOES.h" 31 #include "modules/webgl/WebGLVertexArrayObjectOES.h"
32 32
33 namespace blink { 33 namespace blink {
34 34
35 OESVertexArrayObject::OESVertexArrayObject(WebGLRenderingContextBase* context) 35 OESVertexArrayObject::OESVertexArrayObject(WebGLRenderingContextBase* context)
36 : WebGLExtension(context) { 36 : WebGLExtension(context) {
37 context->extensionsUtil()->ensureExtensionEnabled( 37 context->extensionsUtil()->ensureExtensionEnabled(
38 "GL_OES_vertex_array_object"); 38 "GL_OES_vertex_array_object");
39 } 39 }
40 40
41 OESVertexArrayObject::~OESVertexArrayObject() {}
42
43 WebGLExtensionName OESVertexArrayObject::name() const { 41 WebGLExtensionName OESVertexArrayObject::name() const {
44 return OESVertexArrayObjectName; 42 return OESVertexArrayObjectName;
45 } 43 }
46 44
47 OESVertexArrayObject* OESVertexArrayObject::create( 45 OESVertexArrayObject* OESVertexArrayObject::create(
48 WebGLRenderingContextBase* context) { 46 WebGLRenderingContextBase* context) {
49 return new OESVertexArrayObject(context); 47 return new OESVertexArrayObject(context);
50 } 48 }
51 49
52 WebGLVertexArrayObjectOES* OESVertexArrayObject::createVertexArrayOES() { 50 WebGLVertexArrayObjectOES* OESVertexArrayObject::createVertexArrayOES() {
53 WebGLExtensionScopedContext scoped(this); 51 WebGLExtensionScopedContext scoped(this);
54 if (scoped.isLost()) 52 if (scoped.isLost())
55 return nullptr; 53 return nullptr;
56 54
57 WebGLVertexArrayObjectOES* o = WebGLVertexArrayObjectOES::create( 55 return WebGLVertexArrayObjectOES::create(
58 scoped.context(), WebGLVertexArrayObjectOES::VaoTypeUser); 56 scoped.context(), WebGLVertexArrayObjectOES::VaoTypeUser);
59 scoped.context()->addContextObject(o);
60 return o;
61 } 57 }
62 58
63 void OESVertexArrayObject::deleteVertexArrayOES( 59 void OESVertexArrayObject::deleteVertexArrayOES(
64 WebGLVertexArrayObjectOES* arrayObject) { 60 WebGLVertexArrayObjectOES* arrayObject) {
65 WebGLExtensionScopedContext scoped(this); 61 WebGLExtensionScopedContext scoped(this);
66 if (!arrayObject || scoped.isLost()) 62 if (!arrayObject || scoped.isLost())
67 return; 63 return;
68 64
69 if (!arrayObject->isDefaultObject() && 65 if (!arrayObject->isDefaultObject() &&
70 arrayObject == scoped.context()->m_boundVertexArrayObject) 66 arrayObject == scoped.context()->m_boundVertexArrayObject)
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 bool OESVertexArrayObject::supported(WebGLRenderingContextBase* context) { 108 bool OESVertexArrayObject::supported(WebGLRenderingContextBase* context) {
113 return context->extensionsUtil()->supportsExtension( 109 return context->extensionsUtil()->supportsExtension(
114 "GL_OES_vertex_array_object"); 110 "GL_OES_vertex_array_object");
115 } 111 }
116 112
117 const char* OESVertexArrayObject::extensionName() { 113 const char* OESVertexArrayObject::extensionName() {
118 return "OES_vertex_array_object"; 114 return "OES_vertex_array_object";
119 } 115 }
120 116
121 } // namespace blink 117 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698