mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
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
This commit is contained in:
25
libcef/browser/backing_store_osr.cc
Normal file
25
libcef/browser/backing_store_osr.cc
Normal file
@@ -0,0 +1,25 @@
|
||||
// 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();
|
||||
}
|
Reference in New Issue
Block a user