blob: d4736dd840e47e2a6ebbfe41785ac03b02cb4628 [file] [log] [blame]
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CONTENT_RENDERER_GPU_GPU_BENCHMARKING_EXTENSION_H_
#define CONTENT_RENDERER_GPU_GPU_BENCHMARKING_EXTENSION_H_
#include "base/basictypes.h"
#include "gin/wrappable.h"
namespace blink {
class WebFrame;
}
namespace gin {
class Arguments;
}
namespace v8 {
class Function;
class Isolate;
class Object;
template <typename T> class Handle;
}
namespace content {
// gin class for gpu benchmarking
class GpuBenchmarking : public gin::Wrappable<GpuBenchmarking> {
public:
static gin::WrapperInfo kWrapperInfo;
static void Install(blink::WebFrame* frame);
private:
GpuBenchmarking();
~GpuBenchmarking() override;
// gin::Wrappable.
gin::ObjectTemplateBuilder GetObjectTemplateBuilder(
v8::Isolate* isolate) override;
// JavaScript handlers.
void SetNeedsDisplayOnAllLayers();
void SetRasterizeOnlyVisibleContent();
void PrintToSkPicture(v8::Isolate* isolate, const std::string& dirname);
bool GestureSourceTypeSupported(int gesture_source_type);
bool SmoothScrollBy(gin::Arguments* args);
bool Swipe(gin::Arguments* args);
bool ScrollBounce(gin::Arguments* args);
bool PinchBy(gin::Arguments* args);
bool Tap(gin::Arguments* args);
void BeginWindowSnapshotPNG(v8::Isolate* isolate,
v8::Handle<v8::Function> callback);
void ClearImageCache();
int RunMicroBenchmark(gin::Arguments* args);
bool SendMessageToMicroBenchmark(int id, v8::Handle<v8::Object> message);
bool HasGpuProcess();
DISALLOW_COPY_AND_ASSIGN(GpuBenchmarking);
};
} // namespace content
#endif // CONTENT_RENDERER_GPU_GPU_BENCHMARKING_EXTENSION_H_