Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(156)

Side by Side Diff: gpu/command_buffer/client/gles2_implementation.cc

Issue 8340003: Make GLES2Implementation use a larger chunk size for mapping functions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix typos and formatting Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 // A class to emulate GLES2 over command buffers. 5 // A class to emulate GLES2 over command buffers.
6 6
7 #include "../client/gles2_implementation.h" 7 #include "../client/gles2_implementation.h"
8 8
9 #include <set> 9 #include <set>
10 #include <queue> 10 #include <queue>
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after
555 debug_ = CommandLine::ForCurrentProcess()->HasSwitch( 555 debug_ = CommandLine::ForCurrentProcess()->HasSwitch(
556 switches::kEnableGPUClientLogging); 556 switches::kEnableGPUClientLogging);
557 }); 557 });
558 558
559 // Allocate space for simple GL results. 559 // Allocate space for simple GL results.
560 result_buffer_ = transfer_buffer; 560 result_buffer_ = transfer_buffer;
561 result_shm_offset_ = 0; 561 result_shm_offset_ = 0;
562 memset(&reserved_ids_, 0, sizeof(reserved_ids_)); 562 memset(&reserved_ids_, 0, sizeof(reserved_ids_));
563 563
564 mapped_memory_.reset(new MappedMemoryManager(helper_)); 564 mapped_memory_.reset(new MappedMemoryManager(helper_));
565 SetSharedMemoryChunkSizeMultiple(1024 * 1024 * 2);
565 566
566 if (share_resources) { 567 if (share_resources) {
567 if (!bind_generates_resource) { 568 if (!bind_generates_resource) {
568 buffer_id_handler_.reset( 569 buffer_id_handler_.reset(
569 new StrictSharedIdHandler(this, id_namespaces::kBuffers)); 570 new StrictSharedIdHandler(this, id_namespaces::kBuffers));
570 framebuffer_id_handler_.reset( 571 framebuffer_id_handler_.reset(
571 new StrictSharedIdHandler(this, id_namespaces::kFramebuffers)); 572 new StrictSharedIdHandler(this, id_namespaces::kFramebuffers));
572 renderbuffer_id_handler_.reset( 573 renderbuffer_id_handler_.reset(
573 new StrictSharedIdHandler(this, id_namespaces::kRenderbuffers)); 574 new StrictSharedIdHandler(this, id_namespaces::kRenderbuffers));
574 program_and_shader_id_handler_.reset( 575 program_and_shader_id_handler_.reset(
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
634 reserved_ids_[1])); 635 reserved_ids_[1]));
635 #endif 636 #endif
636 } 637 }
637 638
638 GLES2Implementation::~GLES2Implementation() { 639 GLES2Implementation::~GLES2Implementation() {
639 #if defined(GLES2_SUPPORT_CLIENT_SIDE_ARRAYS) 640 #if defined(GLES2_SUPPORT_CLIENT_SIDE_ARRAYS)
640 DeleteBuffers(arraysize(reserved_ids_), &reserved_ids_[0]); 641 DeleteBuffers(arraysize(reserved_ids_), &reserved_ids_[0]);
641 #endif 642 #endif
642 } 643 }
643 644
645 void GLES2Implementation::SetSharedMemoryChunkSizeMultiple(
646 unsigned int multiple) {
647 mapped_memory_->set_chunk_size_multiple(multiple);
648 }
649
644 void GLES2Implementation::FreeUnusedSharedMemory() { 650 void GLES2Implementation::FreeUnusedSharedMemory() {
645 mapped_memory_->FreeUnused(); 651 mapped_memory_->FreeUnused();
646 } 652 }
647 653
648 void GLES2Implementation::WaitForCmd() { 654 void GLES2Implementation::WaitForCmd() {
649 TRACE_EVENT0("gpu", "GLES2::WaitForCmd"); 655 TRACE_EVENT0("gpu", "GLES2::WaitForCmd");
650 helper_->CommandBufferHelper::Finish(); 656 helper_->CommandBufferHelper::Finish();
651 } 657 }
652 658
653 GLenum GLES2Implementation::GetError() { 659 GLenum GLES2Implementation::GetError() {
(...skipping 1998 matching lines...) Expand 10 before | Expand all | Expand 10 after
2652 2658
2653 void GLES2Implementation::DestroyStreamTextureCHROMIUM(GLuint texture) { 2659 void GLES2Implementation::DestroyStreamTextureCHROMIUM(GLuint texture) {
2654 GPU_CLIENT_LOG("[" << this << "] DestroyStreamTextureCHROMIUM(" 2660 GPU_CLIENT_LOG("[" << this << "] DestroyStreamTextureCHROMIUM("
2655 << texture << ")"); 2661 << texture << ")");
2656 TRACE_EVENT0("gpu", "GLES2::DestroyStreamTextureCHROMIUM"); 2662 TRACE_EVENT0("gpu", "GLES2::DestroyStreamTextureCHROMIUM");
2657 helper_->DestroyStreamTextureCHROMIUM(texture); 2663 helper_->DestroyStreamTextureCHROMIUM(texture);
2658 } 2664 }
2659 2665
2660 } // namespace gles2 2666 } // namespace gles2
2661 } // namespace gpu 2667 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/client/gles2_implementation.h ('k') | gpu/command_buffer/client/mapped_memory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698