software bump
This commit is contained in:
parent
a39bb35744
commit
da5c95710f
5 changed files with 71 additions and 44 deletions
|
@ -16,7 +16,9 @@
|
|||
#include "atom/common/native_mate_converters/string16_converter.h"
|
||||
#include "atom/common/node_includes.h"
|
||||
#include "atom/common/options_switches.h"
|
||||
#include "base/command_line.h"
|
||||
#include "content/public/browser/render_process_host.h"
|
||||
#include "content/public/common/content_switches.h"
|
||||
#include "native_mate/constructor.h"
|
||||
#include "native_mate/dictionary.h"
|
||||
#include "ui/gfx/geometry/rect.h"
|
||||
|
@ -71,6 +73,14 @@ Window::Window(v8::Isolate* isolate, const mate::Dictionary& options) {
|
|||
// Use options.webPreferences to create WebContents.
|
||||
mate::Dictionary web_preferences = mate::Dictionary::CreateEmpty(isolate);
|
||||
options.Get(options::kWebPreferences, &web_preferences);
|
||||
|
||||
bool b;
|
||||
if (options.Get("disableGPU", &b) && b) {
|
||||
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
|
||||
|
||||
command_line->AppendSwitch(::switches::kDisableGpu);
|
||||
command_line->AppendSwitch(::switches::kDisableGpuCompositing);
|
||||
}
|
||||
|
||||
// Copy the backgroundColor to webContents.
|
||||
v8::Local<v8::Value> value;
|
||||
|
|
|
@ -430,7 +430,7 @@ OffScreenWindow::OffScreenWindow(
|
|||
base::ThreadTaskRunnerHandle::Get()));
|
||||
compositor_->SetAcceleratedWidget(compositor_widget_);
|
||||
#endif
|
||||
// compositor_->SetDelegate(this);
|
||||
compositor_->SetDelegate(this);
|
||||
compositor_->SetRootLayer(root_layer_.get());
|
||||
|
||||
ResizeRootLayer();
|
||||
|
@ -894,16 +894,15 @@ void OffScreenWindow::DelegatedFrameHostUpdateVSyncParameters(
|
|||
render_widget_host_->UpdateVSyncParameters(timebase, interval);
|
||||
}
|
||||
|
||||
// std::unique_ptr<cc::SoftwareOutputDevice>
|
||||
// OffScreenWindow::CreateSoftwareOutputDevice(
|
||||
// ui::Compositor* compositor) {
|
||||
// DCHECK_EQ(compositor_.get(), compositor);
|
||||
// DCHECK(!copy_frame_generator_);
|
||||
// DCHECK(!software_output_device_);
|
||||
// std::cout << "CREATED" << std::endl;
|
||||
// software_output_device_ = new OffScreenOutputDevice();
|
||||
// return base::WrapUnique(software_output_device_);
|
||||
// }
|
||||
std::unique_ptr<cc::SoftwareOutputDevice>
|
||||
OffScreenWindow::CreateSoftwareOutputDevice(ui::Compositor* compositor) {
|
||||
DCHECK_EQ(compositor_.get(), compositor);
|
||||
DCHECK(!copy_frame_generator_);
|
||||
DCHECK(!software_output_device_);
|
||||
std::cout << "CREATED" << std::endl;
|
||||
software_output_device_ = new OffScreenOutputDevice();
|
||||
return base::WrapUnique(software_output_device_);
|
||||
}
|
||||
|
||||
void OffScreenWindow::OnSetNeedsBeginFrames(bool enabled) {
|
||||
SetFrameRate();
|
||||
|
|
|
@ -62,7 +62,7 @@ class OffScreenWindow
|
|||
#if defined(OS_MACOSX)
|
||||
public ui::AcceleratedWidgetMacNSView,
|
||||
#endif
|
||||
// public ui::CompositorDelegate,
|
||||
public ui::CompositorDelegate,
|
||||
public content::DelegatedFrameHostClient {
|
||||
public:
|
||||
typedef base::Callback<void(const gfx::Rect&,int,int,void*)>
|
||||
|
@ -170,8 +170,8 @@ public:
|
|||
|
||||
bool IsAutoResizeEnabled() const;
|
||||
|
||||
// std::unique_ptr<cc::SoftwareOutputDevice> CreateSoftwareOutputDevice(
|
||||
// ui::Compositor* compositor) override;
|
||||
std::unique_ptr<cc::SoftwareOutputDevice> CreateSoftwareOutputDevice(
|
||||
ui::Compositor* compositor) override;
|
||||
void OnSetNeedsBeginFrames(bool enabled);
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
const {app, BrowserWindow} = require('electron')
|
||||
const {app, BrowserWindow, contentTracing} = require('electron')
|
||||
const path = require('path')
|
||||
|
||||
const options = {
|
||||
categoryFilter: '*',
|
||||
traceOptions: 'record-until-full,enable-sampling'
|
||||
};
|
||||
|
||||
let mainWindow1 = null
|
||||
let mainWindow2 = null
|
||||
let mainWindow3 = null
|
||||
|
@ -18,6 +23,7 @@ app.on('window-all-closed', () => {
|
|||
exports.load = (appUrl) => {
|
||||
app.on('ready', () => {
|
||||
mainWindow1 = new BrowserWindow({
|
||||
disableGPU: true,
|
||||
width: 800,
|
||||
height: 600,
|
||||
autoHideMenuBar: true,
|
||||
|
@ -44,35 +50,46 @@ exports.load = (appUrl) => {
|
|||
|
||||
start1 = end1
|
||||
})
|
||||
|
||||
/*contentTracing.startRecording(options, () => {
|
||||
console.log('Tracing started');
|
||||
|
||||
// mainWindow2 = new BrowserWindow({
|
||||
// width: 800,
|
||||
// height: 600,
|
||||
// autoHideMenuBar: true,
|
||||
// backgroundColor: '#FFFFFF',
|
||||
// useContentSize: true,
|
||||
// webPreferences: {
|
||||
// nodeIntegration: false
|
||||
// }
|
||||
// })
|
||||
// mainWindow2.loadURL(appUrl)
|
||||
// mainWindow2.focus()
|
||||
// mainWindow2.webContents.on('dom-ready', () => {
|
||||
// mainWindow2.webContents.beginFrameSubscription(() => {
|
||||
// console.log("asd")
|
||||
// })
|
||||
// })
|
||||
//
|
||||
// var start2, end2
|
||||
// start2 = +new Date();
|
||||
// mainWindow2.webContents.on('paint', (e, rect, w, h, data) => {
|
||||
// end2 = +new Date();
|
||||
//
|
||||
// const d = end2 - start2
|
||||
// console.log(`browser #2: ${d < 10 ? ` ${d}` : d} ms`)
|
||||
//
|
||||
// start2 = end2
|
||||
// })
|
||||
setTimeout(() => {
|
||||
contentTracing.stopRecording('', (path) => {
|
||||
console.log('Tracing data recorded to ' + path);
|
||||
});
|
||||
}, 5000);
|
||||
});*/
|
||||
|
||||
mainWindow2 = new BrowserWindow({
|
||||
//disableGPU: false,
|
||||
width: 800,
|
||||
height: 600,
|
||||
autoHideMenuBar: true,
|
||||
backgroundColor: '#FFFFFF',
|
||||
useContentSize: true,
|
||||
webPreferences: {
|
||||
nodeIntegration: false
|
||||
}
|
||||
})
|
||||
mainWindow2.loadURL('http://mrdoob.com/lab/javascript/requestanimationframe/')
|
||||
mainWindow2.focus()
|
||||
mainWindow2.webContents.on('dom-ready', () => {
|
||||
mainWindow2.webContents.beginFrameSubscription(() => {
|
||||
console.log("asd")
|
||||
})
|
||||
})
|
||||
|
||||
var start2, end2
|
||||
start2 = +new Date();
|
||||
mainWindow2.webContents.on('paint', (e, rect, w, h, data) => {
|
||||
end2 = +new Date();
|
||||
|
||||
const d = end2 - start2
|
||||
// console.log(`browser #2: ${d < 10 ? ` ${d}` : d} ms`)
|
||||
|
||||
start2 = end2
|
||||
})
|
||||
//
|
||||
// mainWindow3 = new BrowserWindow({
|
||||
// width: 800,
|
||||
|
|
|
@ -329,5 +329,6 @@ if (option.file && !option.webdriver) {
|
|||
startRepl()
|
||||
} else {
|
||||
const indexPath = path.join(__dirname, '/index.html')
|
||||
loadApplicationByUrl(`http://mrdoob.com/lab/javascript/requestanimationframe/`)
|
||||
loadApplicationByUrl(`http://www.e-try.com/black.htm`)
|
||||
//loadApplicationByUrl(`http://mrdoob.com/lab/javascript/requestanimationframe/`)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue