 Chromium Code Reviews
 Chromium Code Reviews Issue 2629633003:
  Refactor GL bindings so there is no global GLApi or DriverGL.  (Closed)
    
  
    Issue 2629633003:
  Refactor GL bindings so there is no global GLApi or DriverGL.  (Closed) 
  | 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 #include "gpu/command_buffer/service/context_group.h" | 5 #include "gpu/command_buffer/service/context_group.h" | 
| 6 | 6 | 
| 7 #include <stddef.h> | 7 #include <stddef.h> | 
| 8 #include <stdint.h> | 8 #include <stdint.h> | 
| 9 | 9 | 
| 10 #include <algorithm> | 10 #include <algorithm> | 
| (...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 546 } | 546 } | 
| 547 | 547 | 
| 548 if (sampler_manager_ != NULL) { | 548 if (sampler_manager_ != NULL) { | 
| 549 sampler_manager_->Destroy(have_context); | 549 sampler_manager_->Destroy(have_context); | 
| 550 sampler_manager_.reset(); | 550 sampler_manager_.reset(); | 
| 551 ReportProgress(); | 551 ReportProgress(); | 
| 552 } | 552 } | 
| 553 | 553 | 
| 554 memory_tracker_ = NULL; | 554 memory_tracker_ = NULL; | 
| 555 | 555 | 
| 556 passthrough_resources_->Destroy(have_context); | 556 if (passthrough_resources_ != nullptr) { | 
| 
jbauman
2017/01/18 21:32:09
if (passthrough__resources_) {
 
Geoff Lang
2017/01/19 15:40:06
Done.
 | |
| 557 passthrough_resources_.reset(); | 557 passthrough_resources_->Destroy(have_context); | 
| 558 ReportProgress(); | 558 passthrough_resources_.reset(); | 
| 559 ReportProgress(); | |
| 560 } | |
| 559 } | 561 } | 
| 560 | 562 | 
| 561 uint32_t ContextGroup::GetMemRepresented() const { | 563 uint32_t ContextGroup::GetMemRepresented() const { | 
| 562 uint32_t total = 0; | 564 uint32_t total = 0; | 
| 563 if (buffer_manager_.get()) | 565 if (buffer_manager_.get()) | 
| 564 total += buffer_manager_->mem_represented(); | 566 total += buffer_manager_->mem_represented(); | 
| 565 if (renderbuffer_manager_.get()) | 567 if (renderbuffer_manager_.get()) | 
| 566 total += renderbuffer_manager_->mem_represented(); | 568 total += renderbuffer_manager_->mem_represented(); | 
| 567 if (texture_manager_.get()) | 569 if (texture_manager_.get()) | 
| 568 total += texture_manager_->mem_represented(); | 570 total += texture_manager_->mem_represented(); | 
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 624 GLuint client_id, GLuint* service_id) const { | 626 GLuint client_id, GLuint* service_id) const { | 
| 625 Buffer* buffer = buffer_manager_->GetBuffer(client_id); | 627 Buffer* buffer = buffer_manager_->GetBuffer(client_id); | 
| 626 if (!buffer) | 628 if (!buffer) | 
| 627 return false; | 629 return false; | 
| 628 *service_id = buffer->service_id(); | 630 *service_id = buffer->service_id(); | 
| 629 return true; | 631 return true; | 
| 630 } | 632 } | 
| 631 | 633 | 
| 632 } // namespace gles2 | 634 } // namespace gles2 | 
| 633 } // namespace gpu | 635 } // namespace gpu | 
| OLD | NEW |