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

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

Issue 1427543002: Modified old wait sync point functions to also accept new sync tokens. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: format Created 5 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
« no previous file with comments | « cc/test/test_web_graphics_context_3d.h ('k') | cc/trees/layer_tree_host_perftest.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 next_framebuffer_id_(1), 60 next_framebuffer_id_(1),
61 current_framebuffer_(0), 61 current_framebuffer_(0),
62 max_texture_size_(2048), 62 max_texture_size_(2048),
63 reshape_called_(false), 63 reshape_called_(false),
64 width_(0), 64 width_(0),
65 height_(0), 65 height_(0),
66 scale_factor_(-1.f), 66 scale_factor_(-1.f),
67 test_support_(NULL), 67 test_support_(NULL),
68 last_update_type_(NO_UPDATE), 68 last_update_type_(NO_UPDATE),
69 next_insert_sync_point_(1), 69 next_insert_sync_point_(1),
70 last_waited_sync_point_(0),
71 unpack_alignment_(4), 70 unpack_alignment_(4),
72 bound_buffer_(0), 71 bound_buffer_(0),
73 weak_ptr_factory_(this) { 72 weak_ptr_factory_(this) {
74 CreateNamespace(); 73 CreateNamespace();
75 set_support_image(true); 74 set_support_image(true);
76 } 75 }
77 76
78 TestWebGraphicsContext3D::~TestWebGraphicsContext3D() { 77 TestWebGraphicsContext3D::~TestWebGraphicsContext3D() {
79 base::AutoLock lock(g_shared_namespace_lock.Get()); 78 base::AutoLock lock(g_shared_namespace_lock.Get());
80 namespace_ = NULL; 79 namespace_ = NULL;
(...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after
644 base::AutoLock lock(namespace_->lock); 643 base::AutoLock lock(namespace_->lock);
645 base::hash_set<unsigned>& images = namespace_->images; 644 base::hash_set<unsigned>& images = namespace_->images;
646 images.insert(image_id); 645 images.insert(image_id);
647 return image_id; 646 return image_id;
648 } 647 }
649 648
650 unsigned TestWebGraphicsContext3D::insertSyncPoint() { 649 unsigned TestWebGraphicsContext3D::insertSyncPoint() {
651 return next_insert_sync_point_++; 650 return next_insert_sync_point_++;
652 } 651 }
653 652
654 void TestWebGraphicsContext3D::waitSyncPoint(unsigned sync_point) { 653 void TestWebGraphicsContext3D::waitSyncToken(const GLbyte* sync_token) {
655 if (sync_point) 654 if (sync_token) {
656 last_waited_sync_point_ = sync_point; 655 gpu::SyncToken sync_token_data;
656 memcpy(sync_token_data.GetData(), sync_token, sizeof(sync_token_data));
657 if (sync_token_data.HasData())
658 last_waited_sync_token_ = sync_token_data;
659 }
657 } 660 }
658 661
659 size_t TestWebGraphicsContext3D::NumTextures() const { 662 size_t TestWebGraphicsContext3D::NumTextures() const {
660 base::AutoLock lock(namespace_->lock); 663 base::AutoLock lock(namespace_->lock);
661 return namespace_->textures.Size(); 664 return namespace_->textures.Size();
662 } 665 }
663 666
664 GLuint TestWebGraphicsContext3D::TextureAt(int i) const { 667 GLuint TestWebGraphicsContext3D::TextureAt(int i) const {
665 base::AutoLock lock(namespace_->lock); 668 base::AutoLock lock(namespace_->lock);
666 return namespace_->textures.IdAt(i); 669 return namespace_->textures.IdAt(i);
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
816 819
817 TestWebGraphicsContext3D::Buffer::Buffer() : target(0), size(0) {} 820 TestWebGraphicsContext3D::Buffer::Buffer() : target(0), size(0) {}
818 821
819 TestWebGraphicsContext3D::Buffer::~Buffer() {} 822 TestWebGraphicsContext3D::Buffer::~Buffer() {}
820 823
821 TestWebGraphicsContext3D::Image::Image() {} 824 TestWebGraphicsContext3D::Image::Image() {}
822 825
823 TestWebGraphicsContext3D::Image::~Image() {} 826 TestWebGraphicsContext3D::Image::~Image() {}
824 827
825 } // namespace cc 828 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/test_web_graphics_context_3d.h ('k') | cc/trees/layer_tree_host_perftest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698