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

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: Fix mock gpu video accelerator factory 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
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 633 matching lines...) Expand 10 before | Expand all | Expand 10 after
644 base::AutoLock lock(namespace_->lock); 644 base::AutoLock lock(namespace_->lock);
645 base::hash_set<unsigned>& images = namespace_->images; 645 base::hash_set<unsigned>& images = namespace_->images;
646 images.insert(image_id); 646 images.insert(image_id);
647 return image_id; 647 return image_id;
648 } 648 }
649 649
650 unsigned TestWebGraphicsContext3D::insertSyncPoint() { 650 unsigned TestWebGraphicsContext3D::insertSyncPoint() {
651 return next_insert_sync_point_++; 651 return next_insert_sync_point_++;
652 } 652 }
653 653
654 void TestWebGraphicsContext3D::waitSyncPoint(unsigned sync_point) { 654 void TestWebGraphicsContext3D::waitSyncPoint(unsigned sync_point,
655 const GLbyte* sync_token) {
655 if (sync_point) 656 if (sync_point)
656 last_waited_sync_point_ = sync_point; 657 last_waited_sync_point_ = sync_point;
658
659 if (sync_token) {
660 gpu::SyncToken sync_token_data;
661 memcpy(sync_token_data.GetData(), sync_token, sizeof(sync_token_data));
662 if (sync_token_data.HasData())
663 last_waited_sync_token_ = sync_token_data;
664 }
657 } 665 }
658 666
659 size_t TestWebGraphicsContext3D::NumTextures() const { 667 size_t TestWebGraphicsContext3D::NumTextures() const {
660 base::AutoLock lock(namespace_->lock); 668 base::AutoLock lock(namespace_->lock);
661 return namespace_->textures.Size(); 669 return namespace_->textures.Size();
662 } 670 }
663 671
664 GLuint TestWebGraphicsContext3D::TextureAt(int i) const { 672 GLuint TestWebGraphicsContext3D::TextureAt(int i) const {
665 base::AutoLock lock(namespace_->lock); 673 base::AutoLock lock(namespace_->lock);
666 return namespace_->textures.IdAt(i); 674 return namespace_->textures.IdAt(i);
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
816 824
817 TestWebGraphicsContext3D::Buffer::Buffer() : target(0), size(0) {} 825 TestWebGraphicsContext3D::Buffer::Buffer() : target(0), size(0) {}
818 826
819 TestWebGraphicsContext3D::Buffer::~Buffer() {} 827 TestWebGraphicsContext3D::Buffer::~Buffer() {}
820 828
821 TestWebGraphicsContext3D::Image::Image() {} 829 TestWebGraphicsContext3D::Image::Image() {}
822 830
823 TestWebGraphicsContext3D::Image::~Image() {} 831 TestWebGraphicsContext3D::Image::~Image() {}
824 832
825 } // namespace cc 833 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698