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

Side by Side Diff: Source/modules/webgl/WebGLBuffer.cpp

Issue 1300573002: WebGL 2: add readPixels API to read pixels into pixel pack buffer (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: code refactoring to fix bugs in conformance test Created 5 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
« no previous file with comments | « Source/modules/webgl/WebGLBuffer.h ('k') | Source/modules/webgl/WebGLRenderingContextBase.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 21 matching lines...) Expand all
32 namespace blink { 32 namespace blink {
33 33
34 WebGLBuffer* WebGLBuffer::create(WebGLRenderingContextBase* ctx) 34 WebGLBuffer* WebGLBuffer::create(WebGLRenderingContextBase* ctx)
35 { 35 {
36 return new WebGLBuffer(ctx); 36 return new WebGLBuffer(ctx);
37 } 37 }
38 38
39 WebGLBuffer::WebGLBuffer(WebGLRenderingContextBase* ctx) 39 WebGLBuffer::WebGLBuffer(WebGLRenderingContextBase* ctx)
40 : WebGLSharedPlatform3DObject(ctx) 40 : WebGLSharedPlatform3DObject(ctx)
41 , m_initialTarget(0) 41 , m_initialTarget(0)
42 , m_size(0)
42 { 43 {
43 setObject(ctx->webContext()->createBuffer()); 44 setObject(ctx->webContext()->createBuffer());
44 } 45 }
45 46
46 WebGLBuffer::~WebGLBuffer() 47 WebGLBuffer::~WebGLBuffer()
47 { 48 {
48 // See the comment in WebGLObject::detachAndDeleteObject(). 49 // See the comment in WebGLObject::detachAndDeleteObject().
49 detachAndDeleteObject(); 50 detachAndDeleteObject();
50 } 51 }
51 52
52 void WebGLBuffer::deleteObjectImpl(WebGraphicsContext3D* context3d) 53 void WebGLBuffer::deleteObjectImpl(WebGraphicsContext3D* context3d)
53 { 54 {
54 context3d->deleteBuffer(m_object); 55 context3d->deleteBuffer(m_object);
55 m_object = 0; 56 m_object = 0;
56 } 57 }
57 58
58 void WebGLBuffer::setInitialTarget(GLenum target) 59 void WebGLBuffer::setInitialTarget(GLenum target)
59 { 60 {
60 // WebGL restricts the ability to bind buffers to multiple targets based on 61 // WebGL restricts the ability to bind buffers to multiple targets based on
61 // it's initial bind point. 62 // it's initial bind point.
62 ASSERT(!m_initialTarget); 63 ASSERT(!m_initialTarget);
63 m_initialTarget = target; 64 m_initialTarget = target;
64 } 65 }
65 66
66 } // namespace blink 67 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/webgl/WebGLBuffer.h ('k') | Source/modules/webgl/WebGLRenderingContextBase.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698