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

Side by Side Diff: third_party/WebKit/Source/modules/webgl/WebGLBuffer.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) 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2009 Apple 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 24 matching lines...) Expand all
35 } 35 }
36 36
37 WebGLBuffer::WebGLBuffer(WebGLRenderingContextBase* ctx) 37 WebGLBuffer::WebGLBuffer(WebGLRenderingContextBase* ctx)
38 : WebGLSharedPlatform3DObject(ctx), m_initialTarget(0), m_size(0) { 38 : WebGLSharedPlatform3DObject(ctx), m_initialTarget(0), m_size(0) {
39 GLuint buffer; 39 GLuint buffer;
40 ctx->contextGL()->GenBuffers(1, &buffer); 40 ctx->contextGL()->GenBuffers(1, &buffer);
41 setObject(buffer); 41 setObject(buffer);
42 } 42 }
43 43
44 WebGLBuffer::~WebGLBuffer() { 44 WebGLBuffer::~WebGLBuffer() {
45 // See the comment in WebGLObject::detachAndDeleteObject(). 45 runDestructor();
46 detachAndDeleteObject();
47 } 46 }
48 47
49 void WebGLBuffer::deleteObjectImpl(gpu::gles2::GLES2Interface* gl) { 48 void WebGLBuffer::deleteObjectImpl(gpu::gles2::GLES2Interface* gl) {
50 gl->DeleteBuffers(1, &m_object); 49 gl->DeleteBuffers(1, &m_object);
51 m_object = 0; 50 m_object = 0;
52 } 51 }
53 52
54 void WebGLBuffer::setInitialTarget(GLenum target) { 53 void WebGLBuffer::setInitialTarget(GLenum target) {
55 // WebGL restricts the ability to bind buffers to multiple targets based on 54 // WebGL restricts the ability to bind buffers to multiple targets based on
56 // it's initial bind point. 55 // it's initial bind point.
57 ASSERT(!m_initialTarget); 56 ASSERT(!m_initialTarget);
58 m_initialTarget = target; 57 m_initialTarget = target;
59 } 58 }
60 59
61 } // namespace blink 60 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698