Windows: Improvements to off-screen rendering support (issue #518).

- Implement support for transparency. Change the backing store to use Skia instead of GDI and to keep alpha values.
- Implement support for select popups. Requires a patch to Chromium (content_popups.patch).
- Implicitly disable accelerated compositing when using off-screen rendering.
- Introduce a new CefMouseEvent structure for representing mouse event information passed to CefBrowser methods.
- Merge cef_key_event_modifiers_t into cef_event_flags_t.
- Add a new argument to CefBrowser::Invalidate telling the browser whether to invalidate the select popup or the main view.
- Add a new cefclient "transparent-painting-enabled" command-line flag to test transparent off-screen rendering.
- Add a new cefclient "Transparency" test.
- Fix the cefclient off-screen rendering rotation effect to work even when the underlying web content is not updating.
- Add unit tests for transparent painting and select popups.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@979 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2013-01-11 23:00:39 +00:00
parent a463095bd9
commit 7d3bac19a9
41 changed files with 1571 additions and 470 deletions

View File

@@ -975,6 +975,27 @@ enum cef_mouse_button_type_t {
MBT_RIGHT,
};
///
// Structure representing mouse event information.
///
typedef struct _cef_mouse_event_t {
///
// X coordinate relative to the left side of the view.
///
int x;
///
// Y coordinate relative to the top side of the view.
///
int y;
///
// Bit flags describing any pressed modifier keys. See
// cef_event_flags_t for values.
///
uint32 modifiers;
} cef_mouse_event_t;
///
// Paint element types.
///
@@ -988,7 +1009,7 @@ enum cef_paint_element_type_t {
///
enum cef_event_flags_t {
EVENTFLAG_NONE = 0,
EVENTFLAG_CAPS_LOCK_DOWN = 1 << 0,
EVENTFLAG_CAPS_LOCK_ON = 1 << 0,
EVENTFLAG_SHIFT_DOWN = 1 << 1,
EVENTFLAG_CONTROL_DOWN = 1 << 2,
EVENTFLAG_ALT_DOWN = 1 << 3,
@@ -997,8 +1018,10 @@ enum cef_event_flags_t {
EVENTFLAG_RIGHT_MOUSE_BUTTON = 1 << 6,
// Mac OS-X command key.
EVENTFLAG_COMMAND_DOWN = 1 << 7,
// Windows extended key (see WM_KEYDOWN doc).
EVENTFLAG_EXTENDED = 1 << 8,
EVENTFLAG_NUM_LOCK_ON = 1 << 8,
EVENTFLAG_IS_KEY_PAD = 1 << 9,
EVENTFLAG_IS_LEFT = 1 << 10,
EVENTFLAG_IS_RIGHT = 1 << 11,
};
///
@@ -1119,17 +1142,6 @@ enum cef_key_event_type_t {
KEYEVENT_CHAR
};
///
// Key event modifiers.
///
enum cef_key_event_modifiers_t {
KEY_SHIFT = 1 << 0,
KEY_CTRL = 1 << 1,
KEY_ALT = 1 << 2,
KEY_META = 1 << 3,
KEY_KEYPAD = 1 << 4, // Only used on Mac OS-X
};
///
// Structure representing keyboard event information.
///
@@ -1141,9 +1153,9 @@ typedef struct _cef_key_event_t {
///
// Bit flags describing any pressed modifier keys. See
// cef_key_event_modifiers_t for values.
// cef_event_flags_t for values.
///
int modifiers;
uint32 modifiers;
///
// The Windows key code for the key event. This value is used by the DOM

View File

@@ -76,6 +76,9 @@ typedef struct _cef_window_info_t {
BOOL window_rendering_disabled;
// Set to true to enable transparent painting.
// If window rendering is disabled and |transparent_painting| is set to true
// WebKit rendering will draw on a transparent background (RGBA=0x00000000).
// When this value is false the background will be white and opaque.
BOOL transparent_painting;
// Handle for the new browser window.

View File

@@ -199,6 +199,25 @@ struct CefKeyEventTraits {
///
typedef CefStructBase<CefKeyEventTraits> CefKeyEvent;
struct CefMouseEventTraits {
typedef cef_mouse_event_t struct_type;
static inline void init(struct_type* s) {}
static inline void clear(struct_type* s) {}
static inline void set(const struct_type* src, struct_type* target,
bool copy) {
target->x = src->x;
target->y = src->y;
target->modifiers = src->modifiers;
}
};
///
// Class representing a mouse event.
///
typedef CefStructBase<CefMouseEventTraits> CefMouseEvent;
struct CefPopupFeaturesTraits {
typedef cef_popup_features_t struct_type;