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

Side by Side Diff: cc/test/test_web_graphics_context_3d.cc

Issue 270333003: cc: Do not limit number of raster tasks for upload limit. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed TileManagerPerfTest Created 6 years, 7 months 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
« no previous file with comments | « cc/test/test_web_graphics_context_3d.h ('k') | cc/trees/layer_tree_host_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "cc/test/test_web_graphics_context_3d.h" 5 #include "cc/test/test_web_graphics_context_3d.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 max_texture_size_(2048), 60 max_texture_size_(2048),
61 reshape_called_(false), 61 reshape_called_(false),
62 width_(0), 62 width_(0),
63 height_(0), 63 height_(0),
64 scale_factor_(-1.f), 64 scale_factor_(-1.f),
65 test_support_(NULL), 65 test_support_(NULL),
66 last_update_type_(NoUpdate), 66 last_update_type_(NoUpdate),
67 next_insert_sync_point_(1), 67 next_insert_sync_point_(1),
68 last_waited_sync_point_(0), 68 last_waited_sync_point_(0),
69 bound_buffer_(0), 69 bound_buffer_(0),
70 peak_transfer_buffer_memory_used_bytes_(0),
71 weak_ptr_factory_(this) { 70 weak_ptr_factory_(this) {
72 CreateNamespace(); 71 CreateNamespace();
73 } 72 }
74 73
75 TestWebGraphicsContext3D::~TestWebGraphicsContext3D() { 74 TestWebGraphicsContext3D::~TestWebGraphicsContext3D() {
76 base::AutoLock lock(g_shared_namespace_lock.Get()); 75 base::AutoLock lock(g_shared_namespace_lock.Get());
77 namespace_ = NULL; 76 namespace_ = NULL;
78 } 77 }
79 78
80 void TestWebGraphicsContext3D::CreateNamespace() { 79 void TestWebGraphicsContext3D::CreateNamespace() {
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 Buffer* buffer = buffers.get(bound_buffer_); 495 Buffer* buffer = buffers.get(bound_buffer_);
497 if (context_lost_) { 496 if (context_lost_) {
498 buffer->pixels.reset(); 497 buffer->pixels.reset();
499 return; 498 return;
500 } 499 }
501 500
502 buffer->pixels.reset(new uint8[size]); 501 buffer->pixels.reset(new uint8[size]);
503 buffer->size = size; 502 buffer->size = size;
504 if (data != NULL) 503 if (data != NULL)
505 memcpy(buffer->pixels.get(), data, size); 504 memcpy(buffer->pixels.get(), data, size);
506
507 peak_transfer_buffer_memory_used_bytes_ =
508 std::max(peak_transfer_buffer_memory_used_bytes_,
509 GetTransferBufferMemoryUsedBytes());
510 } 505 }
511 506
512 void* TestWebGraphicsContext3D::mapBufferCHROMIUM(GLenum target, 507 void* TestWebGraphicsContext3D::mapBufferCHROMIUM(GLenum target,
513 GLenum access) { 508 GLenum access) {
514 base::AutoLock lock(namespace_->lock); 509 base::AutoLock lock(namespace_->lock);
515 base::ScopedPtrHashMap<unsigned, Buffer>& buffers = namespace_->buffers; 510 base::ScopedPtrHashMap<unsigned, Buffer>& buffers = namespace_->buffers;
516 DCHECK_GT(buffers.count(bound_buffer_), 0u); 511 DCHECK_GT(buffers.count(bound_buffer_), 0u);
517 DCHECK_EQ(target, buffers.get(bound_buffer_)->target); 512 DCHECK_EQ(target, buffers.get(bound_buffer_)->target);
518 if (times_map_buffer_chromium_succeeds_ >= 0) { 513 if (times_map_buffer_chromium_succeeds_ >= 0) {
519 if (!times_map_buffer_chromium_succeeds_) { 514 if (!times_map_buffer_chromium_succeeds_) {
520 return NULL; 515 return NULL;
521 } 516 }
522 --times_map_buffer_chromium_succeeds_; 517 --times_map_buffer_chromium_succeeds_;
523 } 518 }
524 519
525 peak_transfer_buffer_memory_used_bytes_ =
526 std::max(peak_transfer_buffer_memory_used_bytes_,
527 GetTransferBufferMemoryUsedBytes());
528
529 return buffers.get(bound_buffer_)->pixels.get(); 520 return buffers.get(bound_buffer_)->pixels.get();
530 } 521 }
531 522
532 GLboolean TestWebGraphicsContext3D::unmapBufferCHROMIUM( 523 GLboolean TestWebGraphicsContext3D::unmapBufferCHROMIUM(
533 GLenum target) { 524 GLenum target) {
534 base::AutoLock lock(namespace_->lock); 525 base::AutoLock lock(namespace_->lock);
535 base::ScopedPtrHashMap<unsigned, Buffer>& buffers = namespace_->buffers; 526 base::ScopedPtrHashMap<unsigned, Buffer>& buffers = namespace_->buffers;
536 DCHECK_GT(buffers.count(bound_buffer_), 0u); 527 DCHECK_GT(buffers.count(bound_buffer_), 0u);
537 DCHECK_EQ(target, buffers.get(bound_buffer_)->target); 528 DCHECK_EQ(target, buffers.get(bound_buffer_)->target);
538 buffers.get(bound_buffer_)->pixels.reset(); 529 buffers.get(bound_buffer_)->pixels.reset();
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
732 723
733 TestWebGraphicsContext3D::Buffer::Buffer() : target(0), size(0) {} 724 TestWebGraphicsContext3D::Buffer::Buffer() : target(0), size(0) {}
734 725
735 TestWebGraphicsContext3D::Buffer::~Buffer() {} 726 TestWebGraphicsContext3D::Buffer::~Buffer() {}
736 727
737 TestWebGraphicsContext3D::Image::Image() {} 728 TestWebGraphicsContext3D::Image::Image() {}
738 729
739 TestWebGraphicsContext3D::Image::~Image() {} 730 TestWebGraphicsContext3D::Image::~Image() {}
740 731
741 } // namespace cc 732 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/test_web_graphics_context_3d.h ('k') | cc/trees/layer_tree_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698