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

Side by Side Diff: Source/core/platform/graphics/gpu/DrawingBuffer.h

Issue 14217005: Limit the number of WebGL contexts that are active at any given time (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Updated and rebased on DrawingBuffer refactor Created 7 years, 8 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) 2010, Google Inc. All rights reserved. 2 * Copyright (c) 2010, 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 145
146 PassRefPtr<MailboxInfo> getRecycledMailbox(); 146 PassRefPtr<MailboxInfo> getRecycledMailbox();
147 PassRefPtr<MailboxInfo> createNewMailbox(unsigned); 147 PassRefPtr<MailboxInfo> createNewMailbox(unsigned);
148 148
149 // Updates the current size of the buffer, ensuring that s_currentResourceUs ePixels is updated. 149 // Updates the current size of the buffer, ensuring that s_currentResourceUs ePixels is updated.
150 void setSize(const IntSize& size); 150 void setSize(const IntSize& size);
151 151
152 // Calculates the difference in pixels between the current buffer size and t he proposed size. 152 // Calculates the difference in pixels between the current buffer size and t he proposed size.
153 int pixelDelta(const IntSize& size); 153 int pixelDelta(const IntSize& size);
154 154
155 // Given the desired buffer size, provides the largest dimensions that will fit in the pixel budget
156 // Returns true if the buffer will only fit if the oldest WebGL context is f orcibly lost
157 IntSize adjustSizeWithContextEviction(const IntSize&, bool& evictContext);
158
155 PreserveDrawingBuffer m_preserveDrawingBuffer; 159 PreserveDrawingBuffer m_preserveDrawingBuffer;
156 bool m_scissorEnabled; 160 bool m_scissorEnabled;
157 Platform3DObject m_texture2DBinding; 161 Platform3DObject m_texture2DBinding;
158 Platform3DObject m_framebufferBinding; 162 Platform3DObject m_framebufferBinding;
159 GC3Denum m_activeTextureUnit; 163 GC3Denum m_activeTextureUnit;
160 164
161 RefPtr<GraphicsContext3D> m_context; 165 RefPtr<GraphicsContext3D> m_context;
162 IntSize m_size; 166 IntSize m_size;
163 bool m_multisampleExtensionSupported; 167 bool m_multisampleExtensionSupported;
164 bool m_packedDepthStencilExtensionSupported; 168 bool m_packedDepthStencilExtensionSupported;
(...skipping 25 matching lines...) Expand all
190 // All of the mailboxes that this DrawingBuffer has ever created. 194 // All of the mailboxes that this DrawingBuffer has ever created.
191 Vector<RefPtr<MailboxInfo> > m_textureMailboxes; 195 Vector<RefPtr<MailboxInfo> > m_textureMailboxes;
192 // Mailboxes that were released by the compositor and can be used again by t his DrawingBuffer. 196 // Mailboxes that were released by the compositor and can be used again by t his DrawingBuffer.
193 Vector<RefPtr<MailboxInfo> > m_recycledMailboxes; 197 Vector<RefPtr<MailboxInfo> > m_recycledMailboxes;
194 RefPtr<MailboxInfo> m_lastColorBuffer; 198 RefPtr<MailboxInfo> m_lastColorBuffer;
195 }; 199 };
196 200
197 } // namespace WebCore 201 } // namespace WebCore
198 202
199 #endif // DrawingBuffer_h 203 #endif // DrawingBuffer_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698