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

Side by Side Diff: gpu/command_buffer/tests/gl_manager.cc

Issue 2145643004: Fix preserve backbuffer with native GMBs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "gpu/command_buffer/tests/gl_manager.h" 5 #include "gpu/command_buffer/tests/gl_manager.h"
6 6
7 #include <GLES2/gl2.h> 7 #include <GLES2/gl2.h>
8 #include <GLES2/gl2ext.h> 8 #include <GLES2/gl2ext.h>
9 #include <GLES2/gl2extchromium.h> 9 #include <GLES2/gl2extchromium.h>
10 #include <stddef.h> 10 #include <stddef.h>
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 share_group_manager(NULL), 181 share_group_manager(NULL),
182 share_mailbox_manager(NULL), 182 share_mailbox_manager(NULL),
183 virtual_manager(NULL), 183 virtual_manager(NULL),
184 bind_generates_resource(false), 184 bind_generates_resource(false),
185 lose_context_when_out_of_memory(false), 185 lose_context_when_out_of_memory(false),
186 context_lost_allowed(false), 186 context_lost_allowed(false),
187 context_type(gles2::CONTEXT_TYPE_OPENGLES2), 187 context_type(gles2::CONTEXT_TYPE_OPENGLES2),
188 force_shader_name_hashing(false), 188 force_shader_name_hashing(false),
189 multisampled(false), 189 multisampled(false),
190 backbuffer_alpha(true), 190 backbuffer_alpha(true),
191 image_factory(nullptr) {} 191 image_factory(nullptr),
192 preserve_backbuffer(false) {}
192 193
193 GLManager::GLManager() 194 GLManager::GLManager()
194 : sync_point_manager_(nullptr), 195 : sync_point_manager_(nullptr),
195 context_lost_allowed_(false), 196 context_lost_allowed_(false),
196 pause_commands_(false), 197 pause_commands_(false),
197 paused_order_num_(0), 198 paused_order_num_(0),
198 command_buffer_id_( 199 command_buffer_id_(
199 CommandBufferId::FromUnsafeValue(g_next_command_buffer_id++)), 200 CommandBufferId::FromUnsafeValue(g_next_command_buffer_id++)),
200 next_fence_sync_release_(1) { 201 next_fence_sync_release_(1) {
201 SetupBaseContext(); 202 SetupBaseContext();
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 attribs.alpha_size = 8; 287 attribs.alpha_size = 8;
287 attribs.depth_size = 16; 288 attribs.depth_size = 16;
288 attribs.stencil_size = 8; 289 attribs.stencil_size = 8;
289 attribs.context_type = options.context_type; 290 attribs.context_type = options.context_type;
290 attribs.samples = options.multisampled ? 4 : 0; 291 attribs.samples = options.multisampled ? 4 : 0;
291 attribs.sample_buffers = options.multisampled ? 1 : 0; 292 attribs.sample_buffers = options.multisampled ? 1 : 0;
292 attribs.alpha_size = options.backbuffer_alpha ? 8 : 0; 293 attribs.alpha_size = options.backbuffer_alpha ? 8 : 0;
293 attribs.should_use_native_gmb_for_backbuffer = 294 attribs.should_use_native_gmb_for_backbuffer =
294 options.image_factory != nullptr; 295 options.image_factory != nullptr;
295 attribs.offscreen_framebuffer_size = options.size; 296 attribs.offscreen_framebuffer_size = options.size;
297 attribs.buffer_preserved = options.preserve_backbuffer;
296 298
297 if (!context_group) { 299 if (!context_group) {
298 GpuDriverBugWorkarounds gpu_driver_bug_workaround(&command_line); 300 GpuDriverBugWorkarounds gpu_driver_bug_workaround(&command_line);
299 scoped_refptr<gles2::FeatureInfo> feature_info = 301 scoped_refptr<gles2::FeatureInfo> feature_info =
300 new gles2::FeatureInfo(command_line, gpu_driver_bug_workaround); 302 new gles2::FeatureInfo(command_line, gpu_driver_bug_workaround);
301 context_group = new gles2::ContextGroup( 303 context_group = new gles2::ContextGroup(
302 gpu_preferences_, mailbox_manager_.get(), NULL, 304 gpu_preferences_, mailbox_manager_.get(), NULL,
303 new gpu::gles2::ShaderTranslatorCache(gpu_preferences_), 305 new gpu::gles2::ShaderTranslatorCache(gpu_preferences_),
304 new gpu::gles2::FramebufferCompletenessCache, feature_info, 306 new gpu::gles2::FramebufferCompletenessCache, feature_info,
305 options.bind_generates_resource, options.image_factory); 307 options.bind_generates_resource, options.image_factory);
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
628 630
629 // Something went wrong, just run the callback now. 631 // Something went wrong, just run the callback now.
630 callback.Run(); 632 callback.Run();
631 } 633 }
632 634
633 bool GLManager::CanWaitUnverifiedSyncToken(const gpu::SyncToken* sync_token) { 635 bool GLManager::CanWaitUnverifiedSyncToken(const gpu::SyncToken* sync_token) {
634 return false; 636 return false;
635 } 637 }
636 638
637 } // namespace gpu 639 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/tests/gl_manager.h ('k') | gpu/command_buffer/tests/gl_native_gmb_backbuffer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698