| OLD | NEW |
| 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 "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/memory/ptr_util.h" | 6 #include "base/memory/ptr_util.h" |
| 7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" | 9 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" |
| 10 #include "content/browser/gpu/gpu_process_host_ui_shim.h" | 10 #include "content/browser/gpu/gpu_process_host_ui_shim.h" |
| 11 #include "content/common/gpu/client/context_provider_command_buffer.h" | 11 #include "content/common/gpu/client/context_provider_command_buffer.h" |
| 12 #include "content/common/gpu_process_launch_causes.h" | 12 #include "content/common/gpu_process_launch_causes.h" |
| 13 #include "content/public/browser/gpu_data_manager.h" | 13 #include "content/public/browser/gpu_data_manager.h" |
| 14 #include "content/public/common/content_switches.h" | 14 #include "content/public/common/content_switches.h" |
| 15 #include "content/public/test/content_browser_test.h" | 15 #include "content/public/test/content_browser_test.h" |
| 16 #include "third_party/skia/include/core/SkCanvas.h" | 16 #include "third_party/skia/include/core/SkCanvas.h" |
| 17 #include "third_party/skia/include/core/SkPaint.h" | 17 #include "third_party/skia/include/core/SkPaint.h" |
| 18 #include "third_party/skia/include/core/SkSurface.h" | 18 #include "third_party/skia/include/core/SkSurface.h" |
| 19 #include "third_party/skia/include/gpu/GrContext.h" | 19 #include "third_party/skia/include/gpu/GrContext.h" |
| 20 #include "ui/gl/gl_switches.h" | 20 #include "ui/gl/gl_switches.h" |
| 21 | 21 |
| 22 namespace { | 22 namespace { |
| 23 | 23 |
| 24 const content::CauseForGpuLaunch kInitCause = | 24 constexpr content::CauseForGpuLaunch kInitCause = |
| 25 content:: | 25 content::CAUSE_FOR_GPU_LAUNCH_BROWSER_STARTUP; |
| 26 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE; | |
| 27 | 26 |
| 28 scoped_refptr<content::ContextProviderCommandBuffer> CreateContext( | 27 scoped_refptr<content::ContextProviderCommandBuffer> CreateContext( |
| 29 scoped_refptr<gpu::GpuChannelHost> gpu_channel_host) { | 28 scoped_refptr<gpu::GpuChannelHost> gpu_channel_host) { |
| 30 // This is for an offscreen context, so the default framebuffer doesn't need | 29 // This is for an offscreen context, so the default framebuffer doesn't need |
| 31 // any alpha, depth, stencil, antialiasing. | 30 // any alpha, depth, stencil, antialiasing. |
| 32 gpu::gles2::ContextCreationAttribHelper attributes; | 31 gpu::gles2::ContextCreationAttribHelper attributes; |
| 33 attributes.alpha_size = -1; | 32 attributes.alpha_size = -1; |
| 34 attributes.depth_size = 0; | 33 attributes.depth_size = 0; |
| 35 attributes.stencil_size = 0; | 34 attributes.stencil_size = 0; |
| 36 attributes.samples = 0; | 35 attributes.samples = 0; |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 shim->SimulateCrash(); | 281 shim->SimulateCrash(); |
| 283 run_loop.Run(); | 282 run_loop.Run(); |
| 284 | 283 |
| 285 EXPECT_EQ(1, counter); | 284 EXPECT_EQ(1, counter); |
| 286 EXPECT_FALSE(IsChannelEstablished()); | 285 EXPECT_FALSE(IsChannelEstablished()); |
| 287 EstablishAndWait(); | 286 EstablishAndWait(); |
| 288 EXPECT_TRUE(IsChannelEstablished()); | 287 EXPECT_TRUE(IsChannelEstablished()); |
| 289 } | 288 } |
| 290 | 289 |
| 291 } // namespace content | 290 } // namespace content |
| OLD | NEW |