OLD | NEW |
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 "content/renderer/gpu/gpu_benchmarking_extension.h" | 5 #include "content/renderer/gpu/gpu_benchmarking_extension.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 14 matching lines...) Expand all Loading... |
25 #include "content/public/common/content_switches.h" | 25 #include "content/public/common/content_switches.h" |
26 #include "content/public/renderer/chrome_object_extensions_utils.h" | 26 #include "content/public/renderer/chrome_object_extensions_utils.h" |
27 #include "content/public/renderer/render_thread.h" | 27 #include "content/public/renderer/render_thread.h" |
28 #include "content/renderer/gpu/render_widget_compositor.h" | 28 #include "content/renderer/gpu/render_widget_compositor.h" |
29 #include "content/renderer/render_thread_impl.h" | 29 #include "content/renderer/render_thread_impl.h" |
30 #include "content/renderer/render_view_impl.h" | 30 #include "content/renderer/render_view_impl.h" |
31 #include "content/renderer/skia_benchmarking_extension.h" | 31 #include "content/renderer/skia_benchmarking_extension.h" |
32 #include "gin/arguments.h" | 32 #include "gin/arguments.h" |
33 #include "gin/handle.h" | 33 #include "gin/handle.h" |
34 #include "gin/object_template_builder.h" | 34 #include "gin/object_template_builder.h" |
| 35 #include "gpu/ipc/common/gpu_messages.h" |
35 #include "third_party/WebKit/public/web/WebImageCache.h" | 36 #include "third_party/WebKit/public/web/WebImageCache.h" |
36 #include "third_party/WebKit/public/web/WebKit.h" | 37 #include "third_party/WebKit/public/web/WebKit.h" |
37 #include "third_party/WebKit/public/web/WebLocalFrame.h" | 38 #include "third_party/WebKit/public/web/WebLocalFrame.h" |
38 #include "third_party/WebKit/public/web/WebView.h" | 39 #include "third_party/WebKit/public/web/WebView.h" |
39 #include "third_party/skia/include/core/SkData.h" | 40 #include "third_party/skia/include/core/SkData.h" |
40 #include "third_party/skia/include/core/SkGraphics.h" | 41 #include "third_party/skia/include/core/SkGraphics.h" |
41 #include "third_party/skia/include/core/SkPicture.h" | 42 #include "third_party/skia/include/core/SkPicture.h" |
42 #include "third_party/skia/include/core/SkPixelRef.h" | 43 #include "third_party/skia/include/core/SkPixelRef.h" |
43 #include "third_party/skia/include/core/SkPixelSerializer.h" | 44 #include "third_party/skia/include/core/SkPixelSerializer.h" |
44 #include "third_party/skia/include/core/SkStream.h" | 45 #include "third_party/skia/include/core/SkStream.h" |
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
496 .SetMethod("scrollBounce", &GpuBenchmarking::ScrollBounce) | 497 .SetMethod("scrollBounce", &GpuBenchmarking::ScrollBounce) |
497 .SetMethod("pinchBy", &GpuBenchmarking::PinchBy) | 498 .SetMethod("pinchBy", &GpuBenchmarking::PinchBy) |
498 .SetMethod("visualViewportHeight", &GpuBenchmarking::VisualViewportHeight) | 499 .SetMethod("visualViewportHeight", &GpuBenchmarking::VisualViewportHeight) |
499 .SetMethod("visualViewportWidth", &GpuBenchmarking::VisualViewportWidth) | 500 .SetMethod("visualViewportWidth", &GpuBenchmarking::VisualViewportWidth) |
500 .SetMethod("tap", &GpuBenchmarking::Tap) | 501 .SetMethod("tap", &GpuBenchmarking::Tap) |
501 .SetMethod("clearImageCache", &GpuBenchmarking::ClearImageCache) | 502 .SetMethod("clearImageCache", &GpuBenchmarking::ClearImageCache) |
502 .SetMethod("runMicroBenchmark", &GpuBenchmarking::RunMicroBenchmark) | 503 .SetMethod("runMicroBenchmark", &GpuBenchmarking::RunMicroBenchmark) |
503 .SetMethod("sendMessageToMicroBenchmark", | 504 .SetMethod("sendMessageToMicroBenchmark", |
504 &GpuBenchmarking::SendMessageToMicroBenchmark) | 505 &GpuBenchmarking::SendMessageToMicroBenchmark) |
505 .SetMethod("hasGpuChannel", &GpuBenchmarking::HasGpuChannel) | 506 .SetMethod("hasGpuChannel", &GpuBenchmarking::HasGpuChannel) |
506 .SetMethod("hasGpuProcess", &GpuBenchmarking::HasGpuProcess); | 507 .SetMethod("hasGpuProcess", &GpuBenchmarking::HasGpuProcess) |
| 508 .SetMethod("getGpuDriverBugWorkarounds", |
| 509 &GpuBenchmarking::GetGpuDriverBugWorkarounds); |
507 } | 510 } |
508 | 511 |
509 void GpuBenchmarking::SetNeedsDisplayOnAllLayers() { | 512 void GpuBenchmarking::SetNeedsDisplayOnAllLayers() { |
510 GpuBenchmarkingContext context; | 513 GpuBenchmarkingContext context; |
511 if (!context.Init(true)) | 514 if (!context.Init(true)) |
512 return; | 515 return; |
513 | 516 |
514 context.compositor()->SetNeedsDisplayOnAllLayers(); | 517 context.compositor()->SetNeedsDisplayOnAllLayers(); |
515 } | 518 } |
516 | 519 |
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
916 | 919 |
917 bool GpuBenchmarking::HasGpuProcess() { | 920 bool GpuBenchmarking::HasGpuProcess() { |
918 bool has_gpu_process = false; | 921 bool has_gpu_process = false; |
919 if (!RenderThreadImpl::current()->Send( | 922 if (!RenderThreadImpl::current()->Send( |
920 new ChildProcessHostMsg_HasGpuProcess(&has_gpu_process))) | 923 new ChildProcessHostMsg_HasGpuProcess(&has_gpu_process))) |
921 return false; | 924 return false; |
922 | 925 |
923 return has_gpu_process; | 926 return has_gpu_process; |
924 } | 927 } |
925 | 928 |
| 929 void GpuBenchmarking::GetGpuDriverBugWorkarounds(gin::Arguments* args) { |
| 930 std::vector<std::string> gpu_driver_bug_workarounds; |
| 931 gpu::GpuChannelHost* gpu_channel = |
| 932 RenderThreadImpl::current()->GetGpuChannel(); |
| 933 if (!gpu_channel->Send(new GpuChannelMsg_GetDriverBugWorkArounds( |
| 934 &gpu_driver_bug_workarounds))) { |
| 935 return; |
| 936 } |
| 937 |
| 938 v8::Local<v8::Value> result; |
| 939 if (gin::TryConvertToV8(args->isolate(), gpu_driver_bug_workarounds, &result)) |
| 940 args->Return(result); |
| 941 } |
| 942 |
926 } // namespace content | 943 } // namespace content |
OLD | NEW |