| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #include <stddef.h> | 4 #include <stddef.h> |
| 5 #include <stdint.h> | 5 #include <stdint.h> |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/at_exit.h" | 10 #include "base/at_exit.h" |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 completeness_cache_ = new gles2::FramebufferCompletenessCache; | 110 completeness_cache_ = new gles2::FramebufferCompletenessCache; |
| 111 } | 111 } |
| 112 | 112 |
| 113 void InitDecoder() { | 113 void InitDecoder() { |
| 114 context_->MakeCurrent(surface_.get()); | 114 context_->MakeCurrent(surface_.get()); |
| 115 scoped_refptr<gles2::FeatureInfo> feature_info = | 115 scoped_refptr<gles2::FeatureInfo> feature_info = |
| 116 new gles2::FeatureInfo(); | 116 new gles2::FeatureInfo(); |
| 117 scoped_refptr<gles2::ContextGroup> context_group = new gles2::ContextGroup( | 117 scoped_refptr<gles2::ContextGroup> context_group = new gles2::ContextGroup( |
| 118 gpu_preferences_, mailbox_manager_.get(), nullptr, translator_cache_, | 118 gpu_preferences_, mailbox_manager_.get(), nullptr, translator_cache_, |
| 119 completeness_cache_, feature_info, true /* bind_generates_resource */, | 119 completeness_cache_, feature_info, true /* bind_generates_resource */, |
| 120 nullptr /* ImageFactory */); | 120 nullptr /* image_factory */, nullptr /* progress_reporter */); |
| 121 command_buffer_.reset( | 121 command_buffer_.reset( |
| 122 new CommandBufferService(context_group->transfer_buffer_manager())); | 122 new CommandBufferService(context_group->transfer_buffer_manager())); |
| 123 command_buffer_->SetPutOffsetChangeCallback( | 123 command_buffer_->SetPutOffsetChangeCallback( |
| 124 base::Bind(&CommandBufferSetup::PumpCommands, base::Unretained(this))); | 124 base::Bind(&CommandBufferSetup::PumpCommands, base::Unretained(this))); |
| 125 command_buffer_->SetGetBufferChangeCallback(base::Bind( | 125 command_buffer_->SetGetBufferChangeCallback(base::Bind( |
| 126 &CommandBufferSetup::GetBufferChanged, base::Unretained(this))); | 126 &CommandBufferSetup::GetBufferChanged, base::Unretained(this))); |
| 127 InitializeInitialCommandBuffer(); | 127 InitializeInitialCommandBuffer(); |
| 128 | 128 |
| 129 decoder_.reset(gles2::GLES2Decoder::Create(context_group.get())); | 129 decoder_.reset(gles2::GLES2Decoder::Create(context_group.get())); |
| 130 executor_.reset(new CommandExecutor(command_buffer_.get(), decoder_.get(), | 130 executor_.reset(new CommandExecutor(command_buffer_.get(), decoder_.get(), |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 | 294 |
| 295 static gpu::CommandBufferSetup& GetSetup() { | 295 static gpu::CommandBufferSetup& GetSetup() { |
| 296 static gpu::CommandBufferSetup setup; | 296 static gpu::CommandBufferSetup setup; |
| 297 return setup; | 297 return setup; |
| 298 } | 298 } |
| 299 | 299 |
| 300 extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { | 300 extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { |
| 301 GetSetup().RunCommandBuffer(data, size); | 301 GetSetup().RunCommandBuffer(data, size); |
| 302 return 0; | 302 return 0; |
| 303 } | 303 } |
| OLD | NEW |