Chromium Code Reviews| 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 // This file contains the ContextState class. | 5 // This file contains the ContextState class. | 
| 6 | 6 | 
| 7 #ifndef GPU_COMMAND_BUFFER_SERVICE_CONTEXT_STATE_H_ | 7 #ifndef GPU_COMMAND_BUFFER_SERVICE_CONTEXT_STATE_H_ | 
| 8 #define GPU_COMMAND_BUFFER_SERVICE_CONTEXT_STATE_H_ | 8 #define GPU_COMMAND_BUFFER_SERVICE_CONTEXT_STATE_H_ | 
| 9 | 9 | 
| 10 #include <memory> | 10 #include <memory> | 
| (...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 348 | 348 | 
| 349 // If a buffer object is bound to PIXEL_PACK_BUFFER, set all pack parameters | 349 // If a buffer object is bound to PIXEL_PACK_BUFFER, set all pack parameters | 
| 350 // user values; otherwise, set them to 0. | 350 // user values; otherwise, set them to 0. | 
| 351 void UpdatePackParameters() const; | 351 void UpdatePackParameters() const; | 
| 352 // If a buffer object is bound to PIXEL_UNPACK_BUFFER, set all unpack | 352 // If a buffer object is bound to PIXEL_UNPACK_BUFFER, set all unpack | 
| 353 // parameters user values; otherwise, set them to 0. | 353 // parameters user values; otherwise, set them to 0. | 
| 354 void UpdateUnpackParameters() const; | 354 void UpdateUnpackParameters() const; | 
| 355 | 355 | 
| 356 void InitStateManual(const ContextState* prev_state) const; | 356 void InitStateManual(const ContextState* prev_state) const; | 
| 357 | 357 | 
| 358 bool framebuffer_srgb_; | 358 // EnableDisableFramebufferSRGB is called at very high frequency. Cache the | 
| 359 // true value of FRAMEBUFFER_SRGB, if we know it, to elide some of these | |
| 360 // calls. | |
| 361 bool framebuffer_srgb_valid_ = false; | |
| 
 
Zhenyao Mo
2016/11/30 19:31:11
This is nicer than the previous tracking mechanism
 
 | |
| 362 bool framebuffer_srgb_ = false; | |
| 359 | 363 | 
| 360 // Generic vertex attrib base types: FLOAT, INT, or UINT. | 364 // Generic vertex attrib base types: FLOAT, INT, or UINT. | 
| 361 // Each base type is encoded into 2 bits, the lowest 2 bits for location 0, | 365 // Each base type is encoded into 2 bits, the lowest 2 bits for location 0, | 
| 362 // the highest 2 bits for location (max_vertex_attribs - 1). | 366 // the highest 2 bits for location (max_vertex_attribs - 1). | 
| 363 std::vector<uint32_t> generic_attrib_base_type_mask_; | 367 std::vector<uint32_t> generic_attrib_base_type_mask_; | 
| 364 | 368 | 
| 365 GLfloat line_width_min_ = 0.0f; | 369 GLfloat line_width_min_ = 0.0f; | 
| 366 GLfloat line_width_max_ = 1.0f; | 370 GLfloat line_width_max_ = 1.0f; | 
| 367 | 371 | 
| 368 FeatureInfo* feature_info_; | 372 FeatureInfo* feature_info_; | 
| 369 std::unique_ptr<ErrorState> error_state_; | 373 std::unique_ptr<ErrorState> error_state_; | 
| 370 }; | 374 }; | 
| 371 | 375 | 
| 372 } // namespace gles2 | 376 } // namespace gles2 | 
| 373 } // namespace gpu | 377 } // namespace gpu | 
| 374 | 378 | 
| 375 #endif // GPU_COMMAND_BUFFER_SERVICE_CONTEXT_STATE_H_ | 379 #endif // GPU_COMMAND_BUFFER_SERVICE_CONTEXT_STATE_H_ | 
| OLD | NEW |