I tired with the offscreen mode and here are the problems I found:
- [x] <del>The `data` of `paint` event is empty when loading simple local pages.</del>
- [x] The size of `data` is wrong, current implement uses the size of pointer (`sizeof(bitmap_pixels)`).
- [x] Crashes when opening devtools for offscreen window.
- [x] We should probably show a dummy view indicating it is offscreen instead of provide NULL.
- [x] The offscreen window is affecting the rendering of other windows. Try running `./script/test.py -g offscreen` and then refreshing the window.

/cc @gerhardberger @brenca

atom/browser/osr/osr_render_widget_host_view.cc
#include "atom/browser/osr/osr_render_widget_host_view.h"
#include <vector>
#include "base/callback_helpers.h"
#include "base/location.h"
#include "base/memory/ptr_util.h"
#include "base/single_thread_task_runner.h"
#include "base/time/time.h"
#include "cc/output/copy_output_request.h"
#include "cc/scheduler/delay_based_time_source.h"
#include "components/display_compositor/gl_helper.h"
#include "content/browser/renderer_host/render_widget_host_impl.h"
#include "content/browser/renderer_host/render_widget_host_delegate.h"
#include "content/common/view_messages.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/context_factory.h"
#include "content/public/browser/render_widget_host_view_frame_subscriber.h"
#include "ui/compositor/layer.h"
#include "ui/compositor/layer_type.h"
#include "ui/events/latency_info.h"
#include "ui/gfx/geometry/dip_util.h"
#include "ui/gfx/native_widget_types.h"
namespace atom {
namespace {
const float kDefaultScaleFactor = 1.0;
const int kFrameRetryLimit = 2;
}  
class AtomCopyFrameGenerator {