Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(221)

Side by Side Diff: content/renderer/gpu/gpu_benchmarking_extension.cc

Issue 142143005: Convert the SkiaBenchmarkingExtension to a gin::Wrappable class (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | content/renderer/render_thread_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | content/renderer/render_thread_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698