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

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

Issue 1974163003: Expose GpuMemoryBufferId through glGetImageivCHROMIUM. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test. Created 4 years, 6 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
« no previous file with comments | « cc/test/test_web_graphics_context_3d.h ('k') | components/mus/gles2/command_buffer_local.h » ('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 <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after
632 GLenum internalformat, 632 GLenum internalformat,
633 GLenum usage) { 633 GLenum usage) {
634 DCHECK_EQ(GL_RGBA, static_cast<int>(internalformat)); 634 DCHECK_EQ(GL_RGBA, static_cast<int>(internalformat));
635 GLuint image_id = NextImageId(); 635 GLuint image_id = NextImageId();
636 base::AutoLock lock(namespace_->lock); 636 base::AutoLock lock(namespace_->lock);
637 std::unordered_set<unsigned>& images = namespace_->images; 637 std::unordered_set<unsigned>& images = namespace_->images;
638 images.insert(image_id); 638 images.insert(image_id);
639 return image_id; 639 return image_id;
640 } 640 }
641 641
642 void TestWebGraphicsContext3D::getImageivCHROMIUM(GLuint image_id,
643 GLenum param,
644 GLint* data) {
645 DCHECK_EQ(GL_GPU_MEMORY_BUFFER_ID, static_cast<int>(param));
646 base::AutoLock lock(namespace_->lock);
647 std::unordered_set<unsigned>& images = namespace_->images;
648 *data = images.find(image_id) == images.end() ? -1 : 1;
649 }
650
642 GLuint64 TestWebGraphicsContext3D::insertFenceSync() { 651 GLuint64 TestWebGraphicsContext3D::insertFenceSync() {
643 return next_insert_fence_sync_++; 652 return next_insert_fence_sync_++;
644 } 653 }
645 654
646 void TestWebGraphicsContext3D::genSyncToken(GLuint64 fence_sync, 655 void TestWebGraphicsContext3D::genSyncToken(GLuint64 fence_sync,
647 GLbyte* sync_token) { 656 GLbyte* sync_token) {
648 gpu::SyncToken sync_token_data(gpu::CommandBufferNamespace::GPU_IO, 0, 657 gpu::SyncToken sync_token_data(gpu::CommandBufferNamespace::GPU_IO, 0,
649 gpu::CommandBufferId(), fence_sync); 658 gpu::CommandBufferId(), fence_sync);
650 sync_token_data.SetVerifyFlush(); 659 sync_token_data.SetVerifyFlush();
651 memcpy(sync_token, &sync_token_data, sizeof(sync_token_data)); 660 memcpy(sync_token, &sync_token_data, sizeof(sync_token_data));
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
824 833
825 TestWebGraphicsContext3D::Buffer::Buffer() : target(0), size(0) {} 834 TestWebGraphicsContext3D::Buffer::Buffer() : target(0), size(0) {}
826 835
827 TestWebGraphicsContext3D::Buffer::~Buffer() {} 836 TestWebGraphicsContext3D::Buffer::~Buffer() {}
828 837
829 TestWebGraphicsContext3D::Image::Image() {} 838 TestWebGraphicsContext3D::Image::Image() {}
830 839
831 TestWebGraphicsContext3D::Image::~Image() {} 840 TestWebGraphicsContext3D::Image::~Image() {}
832 841
833 } // namespace cc 842 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/test_web_graphics_context_3d.h ('k') | components/mus/gles2/command_buffer_local.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698