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

Side by Side Diff: Source/core/html/canvas/WebGLProgram.h

Issue 365653002: Oilpan: move 2D Canvas and WebGL objects to the heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Smaller adjustments Created 6 years, 5 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
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 20 matching lines...) Expand all
31 #include "core/html/canvas/WebGLShader.h" 31 #include "core/html/canvas/WebGLShader.h"
32 #include "wtf/PassRefPtr.h" 32 #include "wtf/PassRefPtr.h"
33 #include "wtf/Vector.h" 33 #include "wtf/Vector.h"
34 34
35 namespace blink { 35 namespace blink {
36 36
37 class WebGLProgram FINAL : public WebGLSharedObject, public ScriptWrappable { 37 class WebGLProgram FINAL : public WebGLSharedObject, public ScriptWrappable {
38 public: 38 public:
39 virtual ~WebGLProgram(); 39 virtual ~WebGLProgram();
40 40
41 static PassRefPtr<WebGLProgram> create(WebGLRenderingContextBase*); 41 static PassRefPtrWillBeRawPtr<WebGLProgram> create(WebGLRenderingContextBase *);
42 42
43 unsigned numActiveAttribLocations(); 43 unsigned numActiveAttribLocations();
44 GLint getActiveAttribLocation(GLuint index); 44 GLint getActiveAttribLocation(GLuint index);
45 45
46 bool isUsingVertexAttrib0(); 46 bool isUsingVertexAttrib0();
47 47
48 bool linkStatus(); 48 bool linkStatus();
49 49
50 unsigned linkCount() const { return m_linkCount; } 50 unsigned linkCount() const { return m_linkCount; }
51 51
52 // This is to be called everytime after the program is successfully linked. 52 // This is to be called everytime after the program is successfully linked.
53 // We don't deal with integer overflow here, assuming in reality a program 53 // We don't deal with integer overflow here, assuming in reality a program
54 // will never be linked so many times. 54 // will never be linked so many times.
55 // Also, we invalidate the cached program info. 55 // Also, we invalidate the cached program info.
56 void increaseLinkCount(); 56 void increaseLinkCount();
57 57
58 WebGLShader* getAttachedShader(GLenum); 58 WebGLShader* getAttachedShader(GLenum);
59 bool attachShader(WebGLShader*); 59 bool attachShader(WebGLShader*);
60 bool detachShader(WebGLShader*); 60 bool detachShader(WebGLShader*);
61 61
62 virtual void trace(Visitor*) OVERRIDE;
63
62 protected: 64 protected:
63 WebGLProgram(WebGLRenderingContextBase*); 65 explicit WebGLProgram(WebGLRenderingContextBase*);
64 66
65 virtual void deleteObjectImpl(blink::WebGraphicsContext3D*, Platform3DObject ) OVERRIDE; 67 virtual void deleteObjectImpl(blink::WebGraphicsContext3D*, Platform3DObject ) OVERRIDE;
66 68
67 private: 69 private:
68 virtual bool isProgram() const OVERRIDE { return true; } 70 virtual bool isProgram() const OVERRIDE { return true; }
69 71
70 void cacheActiveAttribLocations(blink::WebGraphicsContext3D*); 72 void cacheActiveAttribLocations(blink::WebGraphicsContext3D*);
71 void cacheInfoIfNeeded(); 73 void cacheInfoIfNeeded();
72 74
73 Vector<GLint> m_activeAttribLocations; 75 Vector<GLint> m_activeAttribLocations;
74 76
75 GLint m_linkStatus; 77 GLint m_linkStatus;
76 78
77 // This is used to track whether a WebGLUniformLocation belongs to this 79 // This is used to track whether a WebGLUniformLocation belongs to this
78 // program or not. 80 // program or not.
79 unsigned m_linkCount; 81 unsigned m_linkCount;
80 82
81 RefPtr<WebGLShader> m_vertexShader; 83 RefPtrWillBeMember<WebGLShader> m_vertexShader;
82 RefPtr<WebGLShader> m_fragmentShader; 84 RefPtrWillBeMember<WebGLShader> m_fragmentShader;
83 85
84 bool m_infoValid; 86 bool m_infoValid;
85 }; 87 };
86 88
87 } // namespace blink 89 } // namespace blink
88 90
89 #endif // WebGLProgram_h 91 #endif // WebGLProgram_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698