| 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 <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/base64.h" | 9 #include "base/base64.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 | 64 |
| 65 namespace { | 65 namespace { |
| 66 | 66 |
| 67 class SkPictureSerializer { | 67 class SkPictureSerializer { |
| 68 public: | 68 public: |
| 69 explicit SkPictureSerializer(const base::FilePath& dirpath) | 69 explicit SkPictureSerializer(const base::FilePath& dirpath) |
| 70 : dirpath_(dirpath), | 70 : dirpath_(dirpath), |
| 71 layer_id_(0) { | 71 layer_id_(0) { |
| 72 // Let skia register known effect subclasses. This basically enables | 72 // Let skia register known effect subclasses. This basically enables |
| 73 // reflection on those subclasses required for picture serialization. | 73 // reflection on those subclasses required for picture serialization. |
| 74 content::SkiaBenchmarkingExtension::InitSkGraphics(); | 74 content::SkiaBenchmarking::Initialize(); |
| 75 } | 75 } |
| 76 | 76 |
| 77 // Recursively serializes the layer tree. | 77 // Recursively serializes the layer tree. |
| 78 // Each layer in the tree is serialized into a separate skp file | 78 // Each layer in the tree is serialized into a separate skp file |
| 79 // in the given directory. | 79 // in the given directory. |
| 80 void Serialize(const cc::Layer* layer) { | 80 void Serialize(const cc::Layer* layer) { |
| 81 const cc::LayerList& children = layer->children(); | 81 const cc::LayerList& children = layer->children(); |
| 82 for (size_t i = 0; i < children.size(); ++i) { | 82 for (size_t i = 0; i < children.size(); ++i) { |
| 83 Serialize(children[i].get()); | 83 Serialize(children[i].get()); |
| 84 } | 84 } |
| (...skipping 760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 845 GpuChannelHost* gpu_channel = RenderThreadImpl::current()->GetGpuChannel(); | 845 GpuChannelHost* gpu_channel = RenderThreadImpl::current()->GetGpuChannel(); |
| 846 args.GetReturnValue().Set(!!gpu_channel); | 846 args.GetReturnValue().Set(!!gpu_channel); |
| 847 } | 847 } |
| 848 }; | 848 }; |
| 849 | 849 |
| 850 v8::Extension* GpuBenchmarkingExtension::Get() { | 850 v8::Extension* GpuBenchmarkingExtension::Get() { |
| 851 return new GpuBenchmarkingWrapper(); | 851 return new GpuBenchmarkingWrapper(); |
| 852 } | 852 } |
| 853 | 853 |
| 854 } // namespace content | 854 } // namespace content |
| OLD | NEW |