| 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 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 518 doc->close(); | 518 doc->close(); |
| 519 } | 519 } |
| 520 } | 520 } |
| 521 | 521 |
| 522 // This function is only used for correctness testing of this experimental | 522 // This function is only used for correctness testing of this experimental |
| 523 // feature; no need for it in release builds. | 523 // feature; no need for it in release builds. |
| 524 // Also note: You must execute Chrome with `--no-sandbox` and | 524 // Also note: You must execute Chrome with `--no-sandbox` and |
| 525 // `--enable-gpu-benchmarking` for this to work. | 525 // `--enable-gpu-benchmarking` for this to work. |
| 526 #if defined(OS_WIN) && !defined(NDEBUG) | 526 #if defined(OS_WIN) && !defined(NDEBUG) |
| 527 static sk_sp<SkDocument> MakeXPSDocument(SkWStream* s) { | 527 static sk_sp<SkDocument> MakeXPSDocument(SkWStream* s) { |
| 528 // Hand Skia an image encoder, needed for XPS backend. | |
| 529 skia::SetImageEncoder(&gfx::EncodeSkiaImage); | |
| 530 | |
| 531 // I am not sure why this hasn't been initialized yet. | 528 // I am not sure why this hasn't been initialized yet. |
| 532 (void)CoInitializeEx(nullptr, | 529 (void)CoInitializeEx(nullptr, |
| 533 COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE); | 530 COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE); |
| 534 // In non-sandboxed mode, we will need to create and hold on to the | 531 // In non-sandboxed mode, we will need to create and hold on to the |
| 535 // factory before entering the sandbox. | 532 // factory before entering the sandbox. |
| 536 base::win::ScopedComPtr<IXpsOMObjectFactory> factory; | 533 base::win::ScopedComPtr<IXpsOMObjectFactory> factory; |
| 537 HRESULT hr = factory.CreateInstance(CLSID_XpsOMObjectFactory, nullptr, | 534 HRESULT hr = factory.CreateInstance(CLSID_XpsOMObjectFactory, nullptr, |
| 538 CLSCTX_INPROC_SERVER); | 535 CLSCTX_INPROC_SERVER); |
| 539 if (FAILED(hr) || !factory) { | 536 if (FAILED(hr) || !factory) { |
| 540 LOG(ERROR) << "CoCreateInstance(CLSID_XpsOMObjectFactory, ...) failed:" | 537 LOG(ERROR) << "CoCreateInstance(CLSID_XpsOMObjectFactory, ...) failed:" |
| (...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1137 &gpu_driver_bug_workarounds))) { | 1134 &gpu_driver_bug_workarounds))) { |
| 1138 return; | 1135 return; |
| 1139 } | 1136 } |
| 1140 | 1137 |
| 1141 v8::Local<v8::Value> result; | 1138 v8::Local<v8::Value> result; |
| 1142 if (gin::TryConvertToV8(args->isolate(), gpu_driver_bug_workarounds, &result)) | 1139 if (gin::TryConvertToV8(args->isolate(), gpu_driver_bug_workarounds, &result)) |
| 1143 args->Return(result); | 1140 args->Return(result); |
| 1144 } | 1141 } |
| 1145 | 1142 |
| 1146 } // namespace content | 1143 } // namespace content |
| OLD | NEW |