| 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 GLES2Decoder class. | 5 // This file contains the GLES2Decoder class. |
| 6 | 6 |
| 7 #ifndef GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_H_ | 7 #ifndef GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_H_ |
| 8 #define GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_H_ | 8 #define GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_H_ |
| 9 | 9 |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 bool multisampling; | 38 bool multisampling; |
| 39 bool driver_bug_workarounds; | 39 bool driver_bug_workarounds; |
| 40 }; | 40 }; |
| 41 | 41 |
| 42 // This class implements the AsyncAPIInterface interface, decoding GLES2 | 42 // This class implements the AsyncAPIInterface interface, decoding GLES2 |
| 43 // commands and calling GL. | 43 // commands and calling GL. |
| 44 class GPU_EXPORT GLES2Decoder : public CommonDecoder { | 44 class GPU_EXPORT GLES2Decoder : public CommonDecoder { |
| 45 public: | 45 public: |
| 46 typedef error::Error Error; | 46 typedef error::Error Error; |
| 47 typedef base::Callback<void(int32 id, const std::string& msg)> MsgCallback; | 47 typedef base::Callback<void(int32 id, const std::string& msg)> MsgCallback; |
| 48 typedef base::Callback<void()> DiscardBackbufferCallback; |
| 49 typedef base::Callback<void()> EnsureBackbufferCallback; |
| 48 | 50 |
| 49 // Creates a decoder. | 51 // Creates a decoder. |
| 50 static GLES2Decoder* Create(ContextGroup* group); | 52 static GLES2Decoder* Create(ContextGroup* group); |
| 51 | 53 |
| 52 virtual ~GLES2Decoder(); | 54 virtual ~GLES2Decoder(); |
| 53 | 55 |
| 54 bool debug() const { | 56 bool debug() const { |
| 55 return debug_; | 57 return debug_; |
| 56 } | 58 } |
| 57 | 59 |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 int level, | 159 int level, |
| 158 unsigned format, | 160 unsigned format, |
| 159 unsigned type, | 161 unsigned type, |
| 160 int width, | 162 int width, |
| 161 int height, | 163 int height, |
| 162 bool is_texture_immutable) = 0; | 164 bool is_texture_immutable) = 0; |
| 163 | 165 |
| 164 // A callback for messages from the decoder. | 166 // A callback for messages from the decoder. |
| 165 virtual void SetMsgCallback(const MsgCallback& callback) = 0; | 167 virtual void SetMsgCallback(const MsgCallback& callback) = 0; |
| 166 | 168 |
| 169 // Called when discard/ensure backbuffer messages are decoded. |
| 170 virtual void SetDiscardBackbufferCallback( |
| 171 const DiscardBackbufferCallback& callback) = 0; |
| 172 virtual void SetEnsureBackbufferCallback( |
| 173 const EnsureBackbufferCallback& callback) = 0; |
| 174 |
| 167 static bool IsAngle(); | 175 static bool IsAngle(); |
| 168 | 176 |
| 169 // Used for testing only | 177 // Used for testing only |
| 170 static void set_testing_force_is_angle(bool force); | 178 static void set_testing_force_is_angle(bool force); |
| 171 | 179 |
| 172 protected: | 180 protected: |
| 173 GLES2Decoder(); | 181 GLES2Decoder(); |
| 174 | 182 |
| 175 private: | 183 private: |
| 176 bool debug_; | 184 bool debug_; |
| 177 bool log_commands_; | 185 bool log_commands_; |
| 178 bool log_synthesized_gl_errors_; | 186 bool log_synthesized_gl_errors_; |
| 179 static bool testing_force_is_angle_; | 187 static bool testing_force_is_angle_; |
| 180 | 188 |
| 181 DISALLOW_COPY_AND_ASSIGN(GLES2Decoder); | 189 DISALLOW_COPY_AND_ASSIGN(GLES2Decoder); |
| 182 }; | 190 }; |
| 183 | 191 |
| 184 } // namespace gles2 | 192 } // namespace gles2 |
| 185 } // namespace gpu | 193 } // namespace gpu |
| 186 | 194 |
| 187 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_H_ | 195 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_H_ |
| OLD | NEW |