cef/libcef/browser/backing_store_osr.cc
Marshall Greenblatt 6b7716f64b Windows: Add off-screen rendering support (issue #518).
- Popup menus, drag&drop and GPU acceleration are not currently supported.
- Testing is enabled in cefclient by passing the "off-screen-rendering-enabled" command-line flag.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@919 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-11-21 00:40:15 +00:00

26 lines
998 B
C++

// 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.
#include "libcef/browser/backing_store_osr.h"
#include "ui/gfx/rect.h"
BackingStoreOSR::BackingStoreOSR(content::RenderWidgetHost* widget,
const gfx::Size& size)
: content::BackingStore(widget, size) {
bitmap_.Allocate(size.width(), size.height(), true);
}
void BackingStoreOSR::ScrollBackingStore(const gfx::Vector2d& delta,
const gfx::Rect& clip_rect,
const gfx::Size& view_size) {
SkIRect subset_rect = SkIRect::MakeXYWH(clip_rect.x(), clip_rect.y(),
clip_rect.width(), clip_rect.height());
bitmap_.GetBitmap().scrollRect(&subset_rect, delta.x(), delta.y());
}
const void* BackingStoreOSR::getPixels() const {
return const_cast<BackingStoreOSR*>(this)->bitmap_.GetBitmap().getPixels();
}