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

Side by Side Diff: Source/Platform/chromium/public/WebGraphicsContext3D.h

Issue 13935015: Allow ownership passing of the Callback pointer for signalSyncPoint. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 class WebGraphicsMemoryAllocationChangedCallbackCHROMIUM { 140 class WebGraphicsMemoryAllocationChangedCallbackCHROMIUM {
141 public: 141 public:
142 virtual void onMemoryAllocationChanged(WebGraphicsMemoryAllocation) = 0; 142 virtual void onMemoryAllocationChanged(WebGraphicsMemoryAllocation) = 0;
143 143
144 protected: 144 protected:
145 virtual ~WebGraphicsMemoryAllocationChangedCallbackCHROMIUM() { } 145 virtual ~WebGraphicsMemoryAllocationChangedCallbackCHROMIUM() { }
146 }; 146 };
147 147
148 class WebGraphicsSyncPointCallback { 148 class WebGraphicsSyncPointCallback {
149 public: 149 public:
150 virtual ~WebGraphicsSyncPointCallback() { }
151
150 virtual void onSyncPointReached() = 0; 152 virtual void onSyncPointReached() = 0;
151
152 protected:
153 virtual ~WebGraphicsSyncPointCallback() { }
154 }; 153 };
155 154
156 // This destructor needs to be public so that using classes can destroy inst ances if initialization fails. 155 // This destructor needs to be public so that using classes can destroy inst ances if initialization fails.
157 virtual ~WebGraphicsContext3D() { } 156 virtual ~WebGraphicsContext3D() { }
158 157
159 // Makes the OpenGL context current on the current thread. Returns true on 158 // Makes the OpenGL context current on the current thread. Returns true on
160 // success. 159 // success.
161 virtual bool makeContextCurrent() = 0; 160 virtual bool makeContextCurrent() = 0;
162 161
163 // The size of the region into which this WebGraphicsContext3D is rendering. 162 // The size of the region into which this WebGraphicsContext3D is rendering.
(...skipping 18 matching lines...) Expand all
182 virtual void discardBackbufferCHROMIUM() { } 181 virtual void discardBackbufferCHROMIUM() { }
183 virtual void ensureBackbufferCHROMIUM() { } 182 virtual void ensureBackbufferCHROMIUM() { }
184 183
185 // Query whether it is built on top of compliant GLES2 implementation. 184 // Query whether it is built on top of compliant GLES2 implementation.
186 virtual bool isGLES2Compliant() = 0; 185 virtual bool isGLES2Compliant() = 0;
187 186
188 virtual bool setParentContext(WebGraphicsContext3D* parentContext) { return false; } 187 virtual bool setParentContext(WebGraphicsContext3D* parentContext) { return false; }
189 188
190 virtual unsigned insertSyncPoint() { return 0; } 189 virtual unsigned insertSyncPoint() { return 0; }
191 virtual void waitSyncPoint(unsigned) { } 190 virtual void waitSyncPoint(unsigned) { }
192 virtual void signalSyncPoint(unsigned syncPoint, WebGraphicsSyncPointCallbac k*) { } 191 // This call passes ownership of the WebGraphicsSyncPointCallback to the
192 // WebGraphicsContext3D implementation.
193 virtual void signalSyncPoint(unsigned syncPoint, WebGraphicsSyncPointCallbac k* callback) { delete callback; }
193 194
194 // Helper for software compositing path. Reads back the frame buffer into 195 // Helper for software compositing path. Reads back the frame buffer into
195 // the memory region pointed to by "pixels" with size "bufferSize". It is 196 // the memory region pointed to by "pixels" with size "bufferSize". It is
196 // expected that the storage for "pixels" covers (4 * width * height) bytes. 197 // expected that the storage for "pixels" covers (4 * width * height) bytes.
197 // The RGBA channels are packed into "pixels" using SkBitmap's byte 198 // The RGBA channels are packed into "pixels" using SkBitmap's byte
198 // ordering. Returns true on success. 199 // ordering. Returns true on success.
199 virtual bool readBackFramebuffer(unsigned char* pixels, size_t bufferSize, W ebGLId framebuffer, int width, int height) = 0; 200 virtual bool readBackFramebuffer(unsigned char* pixels, size_t bufferSize, W ebGLId framebuffer, int width, int height) = 0;
200 201
201 // Returns the id of the texture which is used for storing the contents of 202 // Returns the id of the texture which is used for storing the contents of
202 // the framebuffer associated with this context. This texture is accessible 203 // the framebuffer associated with this context. This texture is accessible
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
493 virtual void imageBufferDataCHROMIUM(WGC3Denum target, WGC3Dsizei width, WGC 3Dsizei height) { } 494 virtual void imageBufferDataCHROMIUM(WGC3Denum target, WGC3Dsizei width, WGC 3Dsizei height) { }
494 495
495 protected: 496 protected:
496 virtual GrGLInterface* onCreateGrGLInterface() { return 0; } 497 virtual GrGLInterface* onCreateGrGLInterface() { return 0; }
497 498
498 }; 499 };
499 500
500 } // namespace WebKit 501 } // namespace WebKit
501 502
502 #endif 503 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698