diff options
author | piman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-15 14:22:37 +0000 |
---|---|---|
committer | piman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-15 14:22:37 +0000 |
commit | 64ba52f03b2936af0e6b924417ca8f29958b473e (patch) | |
tree | 62d4f2e60903550e97c618f9074ec92340bfe3f2 /cc/test | |
parent | b5641b965afa45a0c0a1e85a669935e9150ec9f0 (diff) | |
download | chromium_src-64ba52f03b2936af0e6b924417ca8f29958b473e.zip chromium_src-64ba52f03b2936af0e6b924417ca8f29958b473e.tar.gz chromium_src-64ba52f03b2936af0e6b924417ca8f29958b473e.tar.bz2 |
gpu: Generate mailboxes on client side
Because mailboxes are now just a random number, we don't need to round-trip to
the gpu process to generate them, which lets us get rid of IPCs, layers, etc.
It also means generating a mailbox can't fail any more (even on a lost context),
so, removing some code paths and associated tests.
I'm adding a debug-only verification to ensure the mailboxes are generated from
the crypto-random function (in debug, we burn a byte to compute a mini XOR-check
as a sentinel for "we went through the Generate function"). It's not a secure
check, but should hit incorrect/unsafe usage.
BUG=None
Review URL: https://codereview.chromium.org/165393003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@251570 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/test')
-rw-r--r-- | cc/test/test_web_graphics_context_3d.cc | 13 | ||||
-rw-r--r-- | cc/test/test_web_graphics_context_3d.h | 4 |
2 files changed, 0 insertions, 17 deletions
diff --git a/cc/test/test_web_graphics_context_3d.cc b/cc/test/test_web_graphics_context_3d.cc index 27a7b4c..59b7440 100644 --- a/cc/test/test_web_graphics_context_3d.cc +++ b/cc/test/test_web_graphics_context_3d.cc @@ -52,7 +52,6 @@ TestWebGraphicsContext3D::TestWebGraphicsContext3D() : context_id_(s_context_id++), times_bind_texture_succeeds_(-1), times_end_query_succeeds_(-1), - times_gen_mailbox_succeeds_(-1), context_lost_(false), times_map_image_chromium_succeeds_(-1), times_map_buffer_chromium_succeeds_(-1), @@ -428,18 +427,6 @@ void TestWebGraphicsContext3D::getShaderPrecisionFormat(GLenum shadertype, } void TestWebGraphicsContext3D::genMailboxCHROMIUM(GLbyte* mailbox) { - if (times_gen_mailbox_succeeds_ >= 0) { - if (!times_gen_mailbox_succeeds_) { - loseContextCHROMIUM(GL_GUILTY_CONTEXT_RESET_ARB, - GL_INNOCENT_CONTEXT_RESET_ARB); - } - --times_gen_mailbox_succeeds_; - } - if (context_lost_) { - memset(mailbox, 0, GL_MAILBOX_SIZE_CHROMIUM); - return; - } - static char mailbox_name1 = '1'; static char mailbox_name2 = '1'; mailbox[0] = mailbox_name1; diff --git a/cc/test/test_web_graphics_context_3d.h b/cc/test/test_web_graphics_context_3d.h index 1300a8f..39f8767 100644 --- a/cc/test/test_web_graphics_context_3d.h +++ b/cc/test/test_web_graphics_context_3d.h @@ -263,9 +263,6 @@ class TestWebGraphicsContext3D { void set_times_end_query_succeeds(int times) { times_end_query_succeeds_ = times; } - void set_times_gen_mailbox_succeeds(int times) { - times_gen_mailbox_succeeds_ = times; - } // When set, mapImageCHROMIUM and mapBufferCHROMIUM will return NULL after // this many times. @@ -414,7 +411,6 @@ class TestWebGraphicsContext3D { ContextProvider::Capabilities test_capabilities_; int times_bind_texture_succeeds_; int times_end_query_succeeds_; - int times_gen_mailbox_succeeds_; bool context_lost_; int times_map_image_chromium_succeeds_; int times_map_buffer_chromium_succeeds_; |