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