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

Side by Side Diff: content/test/test_context_provider_factory.cc

Issue 199443004: gpu: Raise GL_OUT_OF_MEMORY when BeginQueryEXT fails to allocate. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: checkmem: benchmark Created 6 years, 8 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "content/test/test_context_provider_factory.h" 5 #include "content/test/test_context_provider_factory.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "cc/output/context_provider.h" 8 #include "cc/output/context_provider.h"
9 #include "webkit/common/gpu/context_provider_in_process.h" 9 #include "webkit/common/gpu/context_provider_in_process.h"
10 10
11 namespace content { 11 namespace content {
12 12
13 static TestContextProviderFactory* context_provider_instance = NULL; 13 static TestContextProviderFactory* context_provider_instance = NULL;
14 14
15 // static 15 // static
16 TestContextProviderFactory* TestContextProviderFactory::GetInstance() { 16 TestContextProviderFactory* TestContextProviderFactory::GetInstance() {
17 if (!context_provider_instance) 17 if (!context_provider_instance)
18 context_provider_instance = new TestContextProviderFactory(); 18 context_provider_instance = new TestContextProviderFactory();
19 return context_provider_instance; 19 return context_provider_instance;
20 } 20 }
21 21
22 TestContextProviderFactory::TestContextProviderFactory() {} 22 TestContextProviderFactory::TestContextProviderFactory() {}
23 23
24 TestContextProviderFactory::~TestContextProviderFactory() {} 24 TestContextProviderFactory::~TestContextProviderFactory() {}
25 25
26 scoped_refptr<cc::ContextProvider> TestContextProviderFactory:: 26 scoped_refptr<cc::ContextProvider> TestContextProviderFactory::
27 OffscreenContextProviderForMainThread() { 27 OffscreenContextProviderForMainThread() {
28 if (!main_thread_.get() || main_thread_->DestroyedOnMainThread()) { 28 if (!main_thread_.get() || main_thread_->DestroyedOnMainThread()) {
29 main_thread_ = webkit::gpu::ContextProviderInProcess::CreateOffscreen(); 29 bool lose_context_when_out_of_memory = false;
30 main_thread_ = webkit::gpu::ContextProviderInProcess::CreateOffscreen(
31 lose_context_when_out_of_memory);
30 if (main_thread_.get() && !main_thread_->BindToCurrentThread()) 32 if (main_thread_.get() && !main_thread_->BindToCurrentThread())
31 main_thread_ = NULL; 33 main_thread_ = NULL;
32 } 34 }
33 return main_thread_; 35 return main_thread_;
34 } 36 }
35 37
36 } // namespace content 38 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/renderer_webkitplatformsupport_impl.cc ('k') | gpu/command_buffer/client/gl_in_process_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698