| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_H_ | 5 #ifndef GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_H_ |
| 6 #define GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_H_ | 6 #define GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_H_ |
| 7 | 7 |
| 8 #include <stddef.h> |
| 9 #include <stdint.h> |
| 10 |
| 8 #include <list> | 11 #include <list> |
| 9 #include <map> | 12 #include <map> |
| 10 #include <queue> | 13 #include <queue> |
| 11 #include <set> | 14 #include <set> |
| 12 #include <string> | 15 #include <string> |
| 13 #include <utility> | 16 #include <utility> |
| 14 #include <vector> | 17 #include <vector> |
| 15 | 18 |
| 16 #include "base/basictypes.h" | |
| 17 #include "base/compiler_specific.h" | 19 #include "base/compiler_specific.h" |
| 18 #include "base/macros.h" | 20 #include "base/macros.h" |
| 19 #include "base/memory/scoped_ptr.h" | 21 #include "base/memory/scoped_ptr.h" |
| 20 #include "base/memory/weak_ptr.h" | 22 #include "base/memory/weak_ptr.h" |
| 21 #include "base/trace_event/memory_dump_provider.h" | 23 #include "base/trace_event/memory_dump_provider.h" |
| 22 #include "gpu/command_buffer/client/buffer_tracker.h" | 24 #include "gpu/command_buffer/client/buffer_tracker.h" |
| 23 #include "gpu/command_buffer/client/client_context_state.h" | 25 #include "gpu/command_buffer/client/client_context_state.h" |
| 24 #include "gpu/command_buffer/client/context_support.h" | 26 #include "gpu/command_buffer/client/context_support.h" |
| 25 #include "gpu/command_buffer/client/gles2_impl_export.h" | 27 #include "gpu/command_buffer/client/gles2_impl_export.h" |
| 26 #include "gpu/command_buffer/client/gles2_interface.h" | 28 #include "gpu/command_buffer/client/gles2_interface.h" |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 ~GLStaticState(); | 138 ~GLStaticState(); |
| 137 | 139 |
| 138 typedef std::pair<GLenum, GLenum> ShaderPrecisionKey; | 140 typedef std::pair<GLenum, GLenum> ShaderPrecisionKey; |
| 139 typedef std::map<ShaderPrecisionKey, | 141 typedef std::map<ShaderPrecisionKey, |
| 140 cmds::GetShaderPrecisionFormat::Result> | 142 cmds::GetShaderPrecisionFormat::Result> |
| 141 ShaderPrecisionMap; | 143 ShaderPrecisionMap; |
| 142 ShaderPrecisionMap shader_precisions; | 144 ShaderPrecisionMap shader_precisions; |
| 143 }; | 145 }; |
| 144 | 146 |
| 145 // The maxiumum result size from simple GL get commands. | 147 // The maxiumum result size from simple GL get commands. |
| 146 static const size_t kMaxSizeOfSimpleResult = 16 * sizeof(uint32); // NOLINT. | 148 static const size_t kMaxSizeOfSimpleResult = |
| 149 16 * sizeof(uint32_t); // NOLINT. |
| 147 | 150 |
| 148 // used for testing only. If more things are reseved add them here. | 151 // used for testing only. If more things are reseved add them here. |
| 149 static const unsigned int kStartingOffset = kMaxSizeOfSimpleResult; | 152 static const unsigned int kStartingOffset = kMaxSizeOfSimpleResult; |
| 150 | 153 |
| 151 // Size in bytes to issue async flush for transfer buffer. | 154 // Size in bytes to issue async flush for transfer buffer. |
| 152 static const unsigned int kSizeToFlush = 256 * 1024; | 155 static const unsigned int kSizeToFlush = 256 * 1024; |
| 153 | 156 |
| 154 // The bucket used for results. Public for testing only. | 157 // The bucket used for results. Public for testing only. |
| 155 static const uint32 kResultBucketId = 1; | 158 static const uint32_t kResultBucketId = 1; |
| 156 | 159 |
| 157 // Alignment of allocations. | 160 // Alignment of allocations. |
| 158 static const unsigned int kAlignment = 4; | 161 static const unsigned int kAlignment = 4; |
| 159 | 162 |
| 160 // GL names for the buffers used to emulate client side buffers. | 163 // GL names for the buffers used to emulate client side buffers. |
| 161 static const GLuint kClientSideArrayId = 0xFEDCBA98u; | 164 static const GLuint kClientSideArrayId = 0xFEDCBA98u; |
| 162 static const GLuint kClientSideElementArrayId = 0xFEDCBA99u; | 165 static const GLuint kClientSideElementArrayId = 0xFEDCBA99u; |
| 163 | 166 |
| 164 // Number of swap buffers allowed before waiting. | 167 // Number of swap buffers allowed before waiting. |
| 165 static const size_t kMaxSwapBuffers = 2; | 168 static const size_t kMaxSwapBuffers = 2; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 void CommitOverlayPlanes() override; | 208 void CommitOverlayPlanes() override; |
| 206 void ScheduleOverlayPlane(int plane_z_order, | 209 void ScheduleOverlayPlane(int plane_z_order, |
| 207 gfx::OverlayTransform plane_transform, | 210 gfx::OverlayTransform plane_transform, |
| 208 unsigned overlay_texture_id, | 211 unsigned overlay_texture_id, |
| 209 const gfx::Rect& display_bounds, | 212 const gfx::Rect& display_bounds, |
| 210 const gfx::RectF& uv_rect) override; | 213 const gfx::RectF& uv_rect) override; |
| 211 GLuint InsertFutureSyncPointCHROMIUM() override; | 214 GLuint InsertFutureSyncPointCHROMIUM() override; |
| 212 void RetireSyncPointCHROMIUM(GLuint sync_point) override; | 215 void RetireSyncPointCHROMIUM(GLuint sync_point) override; |
| 213 uint64_t ShareGroupTracingGUID() const override; | 216 uint64_t ShareGroupTracingGUID() const override; |
| 214 | 217 |
| 215 void GetProgramInfoCHROMIUMHelper(GLuint program, std::vector<int8>* result); | 218 void GetProgramInfoCHROMIUMHelper(GLuint program, |
| 219 std::vector<int8_t>* result); |
| 216 GLint GetAttribLocationHelper(GLuint program, const char* name); | 220 GLint GetAttribLocationHelper(GLuint program, const char* name); |
| 217 GLint GetUniformLocationHelper(GLuint program, const char* name); | 221 GLint GetUniformLocationHelper(GLuint program, const char* name); |
| 218 GLint GetFragDataIndexEXTHelper(GLuint program, const char* name); | 222 GLint GetFragDataIndexEXTHelper(GLuint program, const char* name); |
| 219 GLint GetFragDataLocationHelper(GLuint program, const char* name); | 223 GLint GetFragDataLocationHelper(GLuint program, const char* name); |
| 220 bool GetActiveAttribHelper( | 224 bool GetActiveAttribHelper( |
| 221 GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, | 225 GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, |
| 222 GLint* size, GLenum* type, char* name); | 226 GLint* size, GLenum* type, char* name); |
| 223 bool GetActiveUniformHelper( | 227 bool GetActiveUniformHelper( |
| 224 GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, | 228 GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, |
| 225 GLint* size, GLenum* type, char* name); | 229 GLint* size, GLenum* type, char* name); |
| 226 void GetUniformBlocksCHROMIUMHelper( | 230 void GetUniformBlocksCHROMIUMHelper(GLuint program, |
| 227 GLuint program, std::vector<int8>* result); | 231 std::vector<int8_t>* result); |
| 228 void GetUniformsES3CHROMIUMHelper( | 232 void GetUniformsES3CHROMIUMHelper(GLuint program, |
| 229 GLuint program, std::vector<int8>* result); | 233 std::vector<int8_t>* result); |
| 230 GLuint GetUniformBlockIndexHelper(GLuint program, const char* name); | 234 GLuint GetUniformBlockIndexHelper(GLuint program, const char* name); |
| 231 bool GetActiveUniformBlockNameHelper( | 235 bool GetActiveUniformBlockNameHelper( |
| 232 GLuint program, GLuint index, GLsizei bufsize, | 236 GLuint program, GLuint index, GLsizei bufsize, |
| 233 GLsizei* length, char* name); | 237 GLsizei* length, char* name); |
| 234 bool GetActiveUniformBlockivHelper( | 238 bool GetActiveUniformBlockivHelper( |
| 235 GLuint program, GLuint index, GLenum pname, GLint* params); | 239 GLuint program, GLuint index, GLenum pname, GLint* params); |
| 236 void GetTransformFeedbackVaryingsCHROMIUMHelper( | 240 void GetTransformFeedbackVaryingsCHROMIUMHelper(GLuint program, |
| 237 GLuint program, std::vector<int8>* result); | 241 std::vector<int8_t>* result); |
| 238 bool GetTransformFeedbackVaryingHelper( | 242 bool GetTransformFeedbackVaryingHelper( |
| 239 GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, | 243 GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, |
| 240 GLint* size, GLenum* type, char* name); | 244 GLint* size, GLenum* type, char* name); |
| 241 bool GetUniformIndicesHelper( | 245 bool GetUniformIndicesHelper( |
| 242 GLuint program, GLsizei count, const char* const* names, GLuint* indices); | 246 GLuint program, GLsizei count, const char* const* names, GLuint* indices); |
| 243 bool GetActiveUniformsivHelper( | 247 bool GetActiveUniformsivHelper( |
| 244 GLuint program, GLsizei count, const GLuint* indices, | 248 GLuint program, GLsizei count, const GLuint* indices, |
| 245 GLenum pname, GLint* params); | 249 GLenum pname, GLint* params); |
| 246 bool GetSyncivHelper( | 250 bool GetSyncivHelper( |
| 247 GLsync sync, GLenum pname, GLsizei bufsize, GLsizei* length, | 251 GLsync sync, GLenum pname, GLsizei bufsize, GLsizei* length, |
| 248 GLint* values); | 252 GLint* values); |
| 249 bool GetQueryObjectValueHelper( | 253 bool GetQueryObjectValueHelper( |
| 250 const char* function_name, GLuint id, GLenum pname, GLuint64* params); | 254 const char* function_name, GLuint id, GLenum pname, GLuint64* params); |
| 251 | 255 |
| 252 void FreeUnusedSharedMemory(); | 256 void FreeUnusedSharedMemory(); |
| 253 void FreeEverything(); | 257 void FreeEverything(); |
| 254 | 258 |
| 255 // ContextSupport implementation. | 259 // ContextSupport implementation. |
| 256 void SignalSyncPoint(uint32 sync_point, | 260 void SignalSyncPoint(uint32_t sync_point, |
| 257 const base::Closure& callback) override; | 261 const base::Closure& callback) override; |
| 258 void SignalSyncToken(const gpu::SyncToken& sync_token, | 262 void SignalSyncToken(const gpu::SyncToken& sync_token, |
| 259 const base::Closure& callback) override; | 263 const base::Closure& callback) override; |
| 260 void SignalQuery(uint32 query, const base::Closure& callback) override; | 264 void SignalQuery(uint32_t query, const base::Closure& callback) override; |
| 261 void SetAggressivelyFreeResources(bool aggressively_free_resources) override; | 265 void SetAggressivelyFreeResources(bool aggressively_free_resources) override; |
| 262 | 266 |
| 263 // base::trace_event::MemoryDumpProvider implementation. | 267 // base::trace_event::MemoryDumpProvider implementation. |
| 264 bool OnMemoryDump(const base::trace_event::MemoryDumpArgs& args, | 268 bool OnMemoryDump(const base::trace_event::MemoryDumpArgs& args, |
| 265 base::trace_event::ProcessMemoryDump* pmd) override; | 269 base::trace_event::ProcessMemoryDump* pmd) override; |
| 266 | 270 |
| 267 void SetErrorMessageCallback( | 271 void SetErrorMessageCallback( |
| 268 GLES2ImplementationErrorMessageCallback* callback) { | 272 GLES2ImplementationErrorMessageCallback* callback) { |
| 269 error_message_callback_ = callback; | 273 error_message_callback_ = callback; |
| 270 } | 274 } |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 GLES2Implementation* gles2_implementation_; | 410 GLES2Implementation* gles2_implementation_; |
| 407 }; | 411 }; |
| 408 | 412 |
| 409 // Gets the value of the result. | 413 // Gets the value of the result. |
| 410 template <typename T> | 414 template <typename T> |
| 411 T GetResultAs() { | 415 T GetResultAs() { |
| 412 return static_cast<T>(GetResultBuffer()); | 416 return static_cast<T>(GetResultBuffer()); |
| 413 } | 417 } |
| 414 | 418 |
| 415 void* GetResultBuffer(); | 419 void* GetResultBuffer(); |
| 416 int32 GetResultShmId(); | 420 int32_t GetResultShmId(); |
| 417 uint32 GetResultShmOffset(); | 421 uint32_t GetResultShmOffset(); |
| 418 | 422 |
| 419 // Lazily determines if GL_ANGLE_pack_reverse_row_order is available | 423 // Lazily determines if GL_ANGLE_pack_reverse_row_order is available |
| 420 bool IsAnglePackReverseRowOrderAvailable(); | 424 bool IsAnglePackReverseRowOrderAvailable(); |
| 421 bool IsChromiumFramebufferMultisampleAvailable(); | 425 bool IsChromiumFramebufferMultisampleAvailable(); |
| 422 | 426 |
| 423 bool IsExtensionAvailableHelper( | 427 bool IsExtensionAvailableHelper( |
| 424 const char* extension, ExtensionStatus* status); | 428 const char* extension, ExtensionStatus* status); |
| 425 | 429 |
| 426 // Gets the GLError through our wrapper. | 430 // Gets the GLError through our wrapper. |
| 427 GLenum GetGLError(); | 431 GLenum GetGLError(); |
| 428 | 432 |
| 429 // Sets our wrapper for the GLError. | 433 // Sets our wrapper for the GLError. |
| 430 void SetGLError(GLenum error, const char* function_name, const char* msg); | 434 void SetGLError(GLenum error, const char* function_name, const char* msg); |
| 431 void SetGLErrorInvalidEnum( | 435 void SetGLErrorInvalidEnum( |
| 432 const char* function_name, GLenum value, const char* label); | 436 const char* function_name, GLenum value, const char* label); |
| 433 | 437 |
| 434 // Returns the last error and clears it. Useful for debugging. | 438 // Returns the last error and clears it. Useful for debugging. |
| 435 const std::string& GetLastError() { | 439 const std::string& GetLastError() { |
| 436 return last_error_; | 440 return last_error_; |
| 437 } | 441 } |
| 438 | 442 |
| 439 // Waits for all commands to execute. | 443 // Waits for all commands to execute. |
| 440 void WaitForCmd(); | 444 void WaitForCmd(); |
| 441 | 445 |
| 442 // TODO(gman): These bucket functions really seem like they belong in | 446 // TODO(gman): These bucket functions really seem like they belong in |
| 443 // CommandBufferHelper (or maybe BucketHelper?). Unfortunately they need | 447 // CommandBufferHelper (or maybe BucketHelper?). Unfortunately they need |
| 444 // a transfer buffer to function which is currently managed by this class. | 448 // a transfer buffer to function which is currently managed by this class. |
| 445 | 449 |
| 446 // Gets the contents of a bucket. | 450 // Gets the contents of a bucket. |
| 447 bool GetBucketContents(uint32 bucket_id, std::vector<int8>* data); | 451 bool GetBucketContents(uint32_t bucket_id, std::vector<int8_t>* data); |
| 448 | 452 |
| 449 // Sets the contents of a bucket. | 453 // Sets the contents of a bucket. |
| 450 void SetBucketContents(uint32 bucket_id, const void* data, size_t size); | 454 void SetBucketContents(uint32_t bucket_id, const void* data, size_t size); |
| 451 | 455 |
| 452 // Sets the contents of a bucket as a string. | 456 // Sets the contents of a bucket as a string. |
| 453 void SetBucketAsCString(uint32 bucket_id, const char* str); | 457 void SetBucketAsCString(uint32_t bucket_id, const char* str); |
| 454 | 458 |
| 455 // Gets the contents of a bucket as a string. Returns false if there is no | 459 // Gets the contents of a bucket as a string. Returns false if there is no |
| 456 // string available which is a separate case from the empty string. | 460 // string available which is a separate case from the empty string. |
| 457 bool GetBucketAsString(uint32 bucket_id, std::string* str); | 461 bool GetBucketAsString(uint32_t bucket_id, std::string* str); |
| 458 | 462 |
| 459 // Sets the contents of a bucket as a string. | 463 // Sets the contents of a bucket as a string. |
| 460 void SetBucketAsString(uint32 bucket_id, const std::string& str); | 464 void SetBucketAsString(uint32_t bucket_id, const std::string& str); |
| 461 | 465 |
| 462 // Returns true if id is reserved. | 466 // Returns true if id is reserved. |
| 463 bool IsBufferReservedId(GLuint id); | 467 bool IsBufferReservedId(GLuint id); |
| 464 bool IsFramebufferReservedId(GLuint id) { return false; } | 468 bool IsFramebufferReservedId(GLuint id) { return false; } |
| 465 bool IsRenderbufferReservedId(GLuint id) { return false; } | 469 bool IsRenderbufferReservedId(GLuint id) { return false; } |
| 466 bool IsTextureReservedId(GLuint id) { return false; } | 470 bool IsTextureReservedId(GLuint id) { return false; } |
| 467 bool IsVertexArrayReservedId(GLuint id) { return false; } | 471 bool IsVertexArrayReservedId(GLuint id) { return false; } |
| 468 bool IsProgramReservedId(GLuint id) { return false; } | 472 bool IsProgramReservedId(GLuint id) { return false; } |
| 469 bool IsValuebufferReservedId(GLuint id) { return false; } | 473 bool IsValuebufferReservedId(GLuint id) { return false; } |
| 470 bool IsSamplerReservedId(GLuint id) { return false; } | 474 bool IsSamplerReservedId(GLuint id) { return false; } |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 542 GLsizei width, | 546 GLsizei width, |
| 543 GLsizei height, | 547 GLsizei height, |
| 544 GLenum internalformat); | 548 GLenum internalformat); |
| 545 void DestroyImageCHROMIUMHelper(GLuint image_id); | 549 void DestroyImageCHROMIUMHelper(GLuint image_id); |
| 546 GLuint CreateGpuMemoryBufferImageCHROMIUMHelper(GLsizei width, | 550 GLuint CreateGpuMemoryBufferImageCHROMIUMHelper(GLsizei width, |
| 547 GLsizei height, | 551 GLsizei height, |
| 548 GLenum internalformat, | 552 GLenum internalformat, |
| 549 GLenum usage); | 553 GLenum usage); |
| 550 | 554 |
| 551 // Helper for GetVertexAttrib | 555 // Helper for GetVertexAttrib |
| 552 bool GetVertexAttribHelper(GLuint index, GLenum pname, uint32* param); | 556 bool GetVertexAttribHelper(GLuint index, GLenum pname, uint32_t* param); |
| 553 | 557 |
| 554 GLuint GetMaxValueInBufferCHROMIUMHelper( | 558 GLuint GetMaxValueInBufferCHROMIUMHelper( |
| 555 GLuint buffer_id, GLsizei count, GLenum type, GLuint offset); | 559 GLuint buffer_id, GLsizei count, GLenum type, GLuint offset); |
| 556 | 560 |
| 557 void WaitAllAsyncTexImage2DCHROMIUMHelper(); | 561 void WaitAllAsyncTexImage2DCHROMIUMHelper(); |
| 558 | 562 |
| 559 void RestoreElementAndArrayBuffers(bool restore); | 563 void RestoreElementAndArrayBuffers(bool restore); |
| 560 void RestoreArrayBuffer(bool restrore); | 564 void RestoreArrayBuffer(bool restrore); |
| 561 | 565 |
| 562 // The pixels pointer should already account for unpack skip | 566 // The pixels pointer should already account for unpack skip |
| 563 // images/rows/pixels. | 567 // images/rows/pixels. |
| 564 void TexSubImage2DImpl( | 568 void TexSubImage2DImpl(GLenum target, |
| 565 GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, | 569 GLint level, |
| 566 GLsizei height, GLenum format, GLenum type, uint32 unpadded_row_size, | 570 GLint xoffset, |
| 567 const void* pixels, uint32 pixels_padded_row_size, GLboolean internal, | 571 GLint yoffset, |
| 568 ScopedTransferBufferPtr* buffer, uint32 buffer_padded_row_size); | 572 GLsizei width, |
| 569 void TexSubImage3DImpl( | 573 GLsizei height, |
| 570 GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, | 574 GLenum format, |
| 571 GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, | 575 GLenum type, |
| 572 uint32 unpadded_row_size, const void* pixels, | 576 uint32_t unpadded_row_size, |
| 573 uint32 pixels_padded_row_size, GLboolean internal, | 577 const void* pixels, |
| 574 ScopedTransferBufferPtr* buffer, uint32 buffer_padded_row_size); | 578 uint32_t pixels_padded_row_size, |
| 579 GLboolean internal, |
| 580 ScopedTransferBufferPtr* buffer, |
| 581 uint32_t buffer_padded_row_size); |
| 582 void TexSubImage3DImpl(GLenum target, |
| 583 GLint level, |
| 584 GLint xoffset, |
| 585 GLint yoffset, |
| 586 GLint zoffset, |
| 587 GLsizei width, |
| 588 GLsizei height, |
| 589 GLsizei depth, |
| 590 GLenum format, |
| 591 GLenum type, |
| 592 uint32_t unpadded_row_size, |
| 593 const void* pixels, |
| 594 uint32_t pixels_padded_row_size, |
| 595 GLboolean internal, |
| 596 ScopedTransferBufferPtr* buffer, |
| 597 uint32_t buffer_padded_row_size); |
| 575 | 598 |
| 576 // Helpers for query functions. | 599 // Helpers for query functions. |
| 577 bool GetHelper(GLenum pname, GLint* params); | 600 bool GetHelper(GLenum pname, GLint* params); |
| 578 GLuint GetBoundBufferHelper(GLenum target); | 601 GLuint GetBoundBufferHelper(GLenum target); |
| 579 bool GetBooleanvHelper(GLenum pname, GLboolean* params); | 602 bool GetBooleanvHelper(GLenum pname, GLboolean* params); |
| 580 bool GetBufferParameteri64vHelper( | 603 bool GetBufferParameteri64vHelper( |
| 581 GLenum target, GLenum pname, GLint64* params); | 604 GLenum target, GLenum pname, GLint64* params); |
| 582 bool GetBufferParameterivHelper(GLenum target, GLenum pname, GLint* params); | 605 bool GetBufferParameterivHelper(GLenum target, GLenum pname, GLint* params); |
| 583 bool GetFloatvHelper(GLenum pname, GLfloat* params); | 606 bool GetFloatvHelper(GLenum pname, GLfloat* params); |
| 584 bool GetFramebufferAttachmentParameterivHelper( | 607 bool GetFramebufferAttachmentParameterivHelper( |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 648 | 671 |
| 649 const std::string& GetLogPrefix() const; | 672 const std::string& GetLogPrefix() const; |
| 650 | 673 |
| 651 bool PrepareInstancedPathCommand(const char* function_name, | 674 bool PrepareInstancedPathCommand(const char* function_name, |
| 652 GLsizei num_paths, | 675 GLsizei num_paths, |
| 653 GLenum path_name_type, | 676 GLenum path_name_type, |
| 654 const void* paths, | 677 const void* paths, |
| 655 GLenum transform_type, | 678 GLenum transform_type, |
| 656 const GLfloat* transform_values, | 679 const GLfloat* transform_values, |
| 657 ScopedTransferBufferPtr* buffer, | 680 ScopedTransferBufferPtr* buffer, |
| 658 uint32* out_paths_shm_id, | 681 uint32_t* out_paths_shm_id, |
| 659 size_t* out_paths_offset, | 682 size_t* out_paths_offset, |
| 660 uint32* out_transforms_shm_id, | 683 uint32_t* out_transforms_shm_id, |
| 661 size_t* out_transforms_offset); | 684 size_t* out_transforms_offset); |
| 662 #if defined(GL_CLIENT_FAIL_GL_ERRORS) | 685 #if defined(GL_CLIENT_FAIL_GL_ERRORS) |
| 663 void CheckGLError(); | 686 void CheckGLError(); |
| 664 void FailGLError(GLenum error); | 687 void FailGLError(GLenum error); |
| 665 #else | 688 #else |
| 666 void CheckGLError() { } | 689 void CheckGLError() { } |
| 667 void FailGLError(GLenum /* error */) { } | 690 void FailGLError(GLenum /* error */) { } |
| 668 #endif | 691 #endif |
| 669 | 692 |
| 670 void RemoveMappedBufferRangeByTarget(GLenum target); | 693 void RemoveMappedBufferRangeByTarget(GLenum target); |
| 671 void RemoveMappedBufferRangeById(GLuint buffer); | 694 void RemoveMappedBufferRangeById(GLuint buffer); |
| 672 void ClearMappedBufferRangeMap(); | 695 void ClearMappedBufferRangeMap(); |
| 673 | 696 |
| 674 void DrawElementsImpl(GLenum mode, GLsizei count, GLenum type, | 697 void DrawElementsImpl(GLenum mode, GLsizei count, GLenum type, |
| 675 const void* indices, const char* func_name); | 698 const void* indices, const char* func_name); |
| 676 | 699 |
| 677 GLES2Util util_; | 700 GLES2Util util_; |
| 678 GLES2CmdHelper* helper_; | 701 GLES2CmdHelper* helper_; |
| 679 TransferBufferInterface* transfer_buffer_; | 702 TransferBufferInterface* transfer_buffer_; |
| 680 std::string last_error_; | 703 std::string last_error_; |
| 681 DebugMarkerManager debug_marker_manager_; | 704 DebugMarkerManager debug_marker_manager_; |
| 682 std::string this_in_hex_; | 705 std::string this_in_hex_; |
| 683 | 706 |
| 684 std::queue<int32> swap_buffers_tokens_; | 707 std::queue<int32_t> swap_buffers_tokens_; |
| 685 std::queue<int32> rate_limit_tokens_; | 708 std::queue<int32_t> rate_limit_tokens_; |
| 686 | 709 |
| 687 ExtensionStatus angle_pack_reverse_row_order_status_; | 710 ExtensionStatus angle_pack_reverse_row_order_status_; |
| 688 ExtensionStatus chromium_framebuffer_multisample_; | 711 ExtensionStatus chromium_framebuffer_multisample_; |
| 689 | 712 |
| 690 GLStaticState static_state_; | 713 GLStaticState static_state_; |
| 691 ClientContextState state_; | 714 ClientContextState state_; |
| 692 | 715 |
| 693 // pack alignment as last set by glPixelStorei | 716 // pack alignment as last set by glPixelStorei |
| 694 GLint pack_alignment_; | 717 GLint pack_alignment_; |
| 695 | 718 |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 748 GLuint bound_pixel_pack_transfer_buffer_id_; | 771 GLuint bound_pixel_pack_transfer_buffer_id_; |
| 749 GLuint bound_pixel_unpack_transfer_buffer_id_; | 772 GLuint bound_pixel_unpack_transfer_buffer_id_; |
| 750 | 773 |
| 751 // Client side management for vertex array objects. Needed to correctly | 774 // Client side management for vertex array objects. Needed to correctly |
| 752 // track client side arrays. | 775 // track client side arrays. |
| 753 scoped_ptr<VertexArrayObjectManager> vertex_array_object_manager_; | 776 scoped_ptr<VertexArrayObjectManager> vertex_array_object_manager_; |
| 754 | 777 |
| 755 GLuint reserved_ids_[2]; | 778 GLuint reserved_ids_[2]; |
| 756 | 779 |
| 757 // Current GL error bits. | 780 // Current GL error bits. |
| 758 uint32 error_bits_; | 781 uint32_t error_bits_; |
| 759 | 782 |
| 760 // Whether or not to print debugging info. | 783 // Whether or not to print debugging info. |
| 761 bool debug_; | 784 bool debug_; |
| 762 | 785 |
| 763 // When true, the context is lost when a GL_OUT_OF_MEMORY error occurs. | 786 // When true, the context is lost when a GL_OUT_OF_MEMORY error occurs. |
| 764 const bool lose_context_when_out_of_memory_; | 787 const bool lose_context_when_out_of_memory_; |
| 765 | 788 |
| 766 // Whether or not to support client side arrays. | 789 // Whether or not to support client side arrays. |
| 767 const bool support_client_side_arrays_; | 790 const bool support_client_side_arrays_; |
| 768 | 791 |
| 769 // Used to check for single threaded access. | 792 // Used to check for single threaded access. |
| 770 int use_count_; | 793 int use_count_; |
| 771 | 794 |
| 772 // Maximum amount of extra memory from the mapped memory pool to use when | 795 // Maximum amount of extra memory from the mapped memory pool to use when |
| 773 // needing to transfer something exceeding the default transfer buffer. | 796 // needing to transfer something exceeding the default transfer buffer. |
| 774 // This should be 0 for low memory devices since they are already memory | 797 // This should be 0 for low memory devices since they are already memory |
| 775 // constrained. | 798 // constrained. |
| 776 const uint32_t max_extra_transfer_buffer_size_; | 799 const uint32_t max_extra_transfer_buffer_size_; |
| 777 | 800 |
| 778 // Map of GLenum to Strings for glGetString. We need to cache these because | 801 // Map of GLenum to Strings for glGetString. We need to cache these because |
| 779 // the pointer passed back to the client has to remain valid for eternity. | 802 // the pointer passed back to the client has to remain valid for eternity. |
| 780 typedef std::map<uint32, std::set<std::string> > GLStringMap; | 803 typedef std::map<uint32_t, std::set<std::string>> GLStringMap; |
| 781 GLStringMap gl_strings_; | 804 GLStringMap gl_strings_; |
| 782 | 805 |
| 783 // Similar cache for glGetRequestableExtensionsCHROMIUM. We don't | 806 // Similar cache for glGetRequestableExtensionsCHROMIUM. We don't |
| 784 // have an enum for this so handle it separately. | 807 // have an enum for this so handle it separately. |
| 785 std::set<std::string> requestable_extensions_set_; | 808 std::set<std::string> requestable_extensions_set_; |
| 786 | 809 |
| 787 typedef std::map<const void*, MappedBuffer> MappedBufferMap; | 810 typedef std::map<const void*, MappedBuffer> MappedBufferMap; |
| 788 MappedBufferMap mapped_buffers_; | 811 MappedBufferMap mapped_buffers_; |
| 789 | 812 |
| 790 // TODO(zmo): Consolidate |mapped_buffers_| and |mapped_buffer_range_map_|. | 813 // TODO(zmo): Consolidate |mapped_buffers_| and |mapped_buffer_range_map_|. |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 856 | 879 |
| 857 inline bool GLES2Implementation::GetTexParameterivHelper( | 880 inline bool GLES2Implementation::GetTexParameterivHelper( |
| 858 GLenum /* target */, GLenum /* pname */, GLint* /* params */) { | 881 GLenum /* target */, GLenum /* pname */, GLint* /* params */) { |
| 859 return false; | 882 return false; |
| 860 } | 883 } |
| 861 | 884 |
| 862 } // namespace gles2 | 885 } // namespace gles2 |
| 863 } // namespace gpu | 886 } // namespace gpu |
| 864 | 887 |
| 865 #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_H_ | 888 #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_H_ |
| OLD | NEW |