| 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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 layer_id_(0) { | 119 layer_id_(0) { |
| 120 // Let skia register known effect subclasses. This basically enables | 120 // Let skia register known effect subclasses. This basically enables |
| 121 // reflection on those subclasses required for picture serialization. | 121 // reflection on those subclasses required for picture serialization. |
| 122 SkiaBenchmarking::Initialize(); | 122 SkiaBenchmarking::Initialize(); |
| 123 } | 123 } |
| 124 | 124 |
| 125 // Recursively serializes the layer tree. | 125 // Recursively serializes the layer tree. |
| 126 // Each layer in the tree is serialized into a separate skp file | 126 // Each layer in the tree is serialized into a separate skp file |
| 127 // in the given directory. | 127 // in the given directory. |
| 128 void Serialize(const cc::Layer* root_layer) { | 128 void Serialize(const cc::Layer* root_layer) { |
| 129 for (auto* layer : *root_layer->layer_tree_host()) { | 129 for (auto* layer : *root_layer->GetLayerTree()) { |
| 130 sk_sp<SkPicture> picture = layer->GetPicture(); | 130 sk_sp<SkPicture> picture = layer->GetPicture(); |
| 131 if (!picture) | 131 if (!picture) |
| 132 continue; | 132 continue; |
| 133 | 133 |
| 134 // Serialize picture to file. | 134 // Serialize picture to file. |
| 135 // TODO(alokp): Note that for this to work Chrome needs to be launched | 135 // TODO(alokp): Note that for this to work Chrome needs to be launched |
| 136 // with | 136 // with |
| 137 // --no-sandbox command-line flag. Get rid of this limitation. | 137 // --no-sandbox command-line flag. Get rid of this limitation. |
| 138 // CRBUG: 139640. | 138 // CRBUG: 139640. |
| 139 std::string filename = "layer_" + base::IntToString(layer_id_++) + ".skp"; | 139 std::string filename = "layer_" + base::IntToString(layer_id_++) + ".skp"; |
| (...skipping 821 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 961 &gpu_driver_bug_workarounds))) { | 961 &gpu_driver_bug_workarounds))) { |
| 962 return; | 962 return; |
| 963 } | 963 } |
| 964 | 964 |
| 965 v8::Local<v8::Value> result; | 965 v8::Local<v8::Value> result; |
| 966 if (gin::TryConvertToV8(args->isolate(), gpu_driver_bug_workarounds, &result)) | 966 if (gin::TryConvertToV8(args->isolate(), gpu_driver_bug_workarounds, &result)) |
| 967 args->Return(result); | 967 args->Return(result); |
| 968 } | 968 } |
| 969 | 969 |
| 970 } // namespace content | 970 } // namespace content |
| OLD | NEW |