Add support for transparency on Windows (issue #99).

- Enable the use of Skia instead of GDI for text rendering.
- Add a new CefWindowInfo::m_bTransparentPainting member.
- Add transparent popup window and off-screen rendering examples to cefclient.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@334 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2011-10-21 19:35:19 +00:00
parent 34f6a2141e
commit 561bb6956b
19 changed files with 316 additions and 45 deletions

View File

@ -16,6 +16,7 @@
#include "third_party/WebKit/Source/WebKit/chromium/public/WebSize.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebVector.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/win/WebInputEventFactory.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/win/WebScreenInfoFactory.h"
#include "ui/base/ime/composition_text.h"
@ -709,6 +710,17 @@ void WebWidgetHost::PaintRect(const gfx::Rect& rect) {
#endif
DCHECK(canvas_.get());
if (!popup() && ((WebKit::WebView*)webwidget_)->isTransparent()) {
// When using transparency mode clear the rectangle before painting.
SkPaint clearpaint;
clearpaint.setARGB(0,0,0,0);
clearpaint.setXfermodeMode(SkXfermode::kClear_Mode);
SkRect skrc;
skrc.set(rect.x(), rect.y(), rect.right(), rect.bottom());
canvas_->drawRect(skrc, clearpaint);
}
set_painting(true);
webwidget_->paint(canvas_.get(), rect);
set_painting(false);