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

Side by Side Diff: Source/core/html/canvas/WebGLBuffer.cpp

Issue 540283003: bindings: Retires ScriptWrappable::init, etc. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Addressed a review comment. Created 6 years, 3 months 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 | Annotate | Revision Log
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 22 matching lines...) Expand all
33 33
34 PassRefPtrWillBeRawPtr<WebGLBuffer> WebGLBuffer::create(WebGLRenderingContextBas e* ctx) 34 PassRefPtrWillBeRawPtr<WebGLBuffer> WebGLBuffer::create(WebGLRenderingContextBas e* ctx)
35 { 35 {
36 return adoptRefWillBeNoop(new WebGLBuffer(ctx)); 36 return adoptRefWillBeNoop(new WebGLBuffer(ctx));
37 } 37 }
38 38
39 WebGLBuffer::WebGLBuffer(WebGLRenderingContextBase* ctx) 39 WebGLBuffer::WebGLBuffer(WebGLRenderingContextBase* ctx)
40 : WebGLSharedObject(ctx) 40 : WebGLSharedObject(ctx)
41 , m_target(0) 41 , m_target(0)
42 { 42 {
43 ScriptWrappable::init(this);
44 setObject(ctx->webContext()->createBuffer()); 43 setObject(ctx->webContext()->createBuffer());
45 } 44 }
46 45
47 WebGLBuffer::~WebGLBuffer() 46 WebGLBuffer::~WebGLBuffer()
48 { 47 {
49 // Delete the buffer's platform object. This object will have been 48 // Delete the buffer's platform object. This object will have been
50 // detached from the WebGLContextGroup if the group object was 49 // detached from the WebGLContextGroup if the group object was
51 // finalized first. With Oilpan not enabled, it always will be, 50 // finalized first. With Oilpan not enabled, it always will be,
52 // but with Oilpan enabled, the WebGLBuffer might end up being 51 // but with Oilpan enabled, the WebGLBuffer might end up being
53 // finalized first. In which case detachment is needed to ensure 52 // finalized first. In which case detachment is needed to ensure
(...skipping 12 matching lines...) Expand all
66 void WebGLBuffer::setTarget(GLenum target) 65 void WebGLBuffer::setTarget(GLenum target)
67 { 66 {
68 // In WebGL, a buffer is bound to one target in its lifetime 67 // In WebGL, a buffer is bound to one target in its lifetime
69 if (m_target) 68 if (m_target)
70 return; 69 return;
71 if (target == GL_ARRAY_BUFFER || target == GL_ELEMENT_ARRAY_BUFFER) 70 if (target == GL_ARRAY_BUFFER || target == GL_ELEMENT_ARRAY_BUFFER)
72 m_target = target; 71 m_target = target;
73 } 72 }
74 73
75 } 74 }
OLDNEW
« no previous file with comments | « Source/core/html/canvas/WebGLActiveInfo.h ('k') | Source/core/html/canvas/WebGLCompressedTextureATC.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698