WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED INVALID
66557
[Qt] Make QDesktopWebView a QSGItem.
https://bugs.webkit.org/show_bug.cgi?id=66557
Summary
[Qt] Make QDesktopWebView a QSGItem.
Andreas Kling
Reported
2011-08-19 07:27:19 PDT
[Qt] Make QDesktopWebView a QSGItem.
Attachments
Patch
(11.06 KB, patch)
2011-08-19 07:54 PDT
,
Andreas Kling
kling
: review-
Details
Formatted Diff
Diff
Proposed patch v2
(11.01 KB, patch)
2011-08-22 04:09 PDT
,
Andreas Kling
no flags
Details
Formatted Diff
Diff
Proposed patch v3
(11.00 KB, patch)
2011-08-22 04:21 PDT
,
Andreas Kling
no flags
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Andreas Kling
Comment 1
2011-08-19 07:54:17 PDT
Created
attachment 104510
[details]
Patch
Kenneth Rohde Christiansen
Comment 2
2011-08-19 07:58:30 PDT
Comment on
attachment 104510
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=104510&action=review
> Source/WebKit2/UIProcess/API/qt/qdesktopwebview.cpp:47 > + , geometry(QSGGeometry::defaultAttributes_TexturedPoint2D(), 4)
maybe add a comment before the 4?
> Source/WebKit2/UIProcess/API/qt/qdesktopwebview.cpp:56 > +static QImage createCrashedPageImage(int width, int height)
so the page image crashed? :-) Darn we need a better name
Jocelyn Turcotte
Comment 3
2011-08-19 10:22:48 PDT
Comment on
attachment 104510
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=104510&action=review
> Source/WebKit2/UIProcess/API/qt/qdesktopwebview.cpp:67 > + QSGGeometryNode* node = reinterpret_cast<QSGGeometryNode*>(oldNode);
static_cast?
> Source/WebKit2/UIProcess/API/qt/qdesktopwebview.cpp:83 > + QRectF textureSourceRect(0, 0, width() / backingStoreImage.width(), height() / backingStoreImage.height());
QSGTexture::convertToNormalizedSourceRect can do that for you.
> Source/WebKit2/UIProcess/API/qt/qdesktopwebview.cpp:86 > + delete d->material.texture();
Would be cleaner to keep it in a local variable and delete it later, in cases where QSGMaterial::setTexture would decides to access it's current texture.
Benjamin Poulain
Comment 4
2011-08-21 15:45:20 PDT
Comment on
attachment 104510
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=104510&action=review
> Source/WebKit2/UIProcess/API/qt/qdesktopwebview.h:51 > -class QWEBKIT_EXPORT QDesktopWebView : public QSGPaintedItem { > +class QWEBKIT_EXPORT QDesktopWebView : public QSGItem {
The include <QtDeclarative/qsgpainteditem.h> can be removed.
> Source/WebKit2/UIProcess/API/qt/qdesktopwebview.h:101 > + virtual QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *);
Currently we use WebKit style for public headers.
Andreas Kling
Comment 5
2011-08-21 22:40:15 PDT
Comment on
attachment 104510
[details]
Patch Will make an updated patch with everyone's comments addressed, thanks.
Andreas Kling
Comment 6
2011-08-22 04:09:29 PDT
Created
attachment 104662
[details]
Proposed patch v2 Updated patch according to comments. Didn't end up using QSGTexture::convertToNormalizedSourceRect() since that got more verbose than the old code. And we now delete the texture in ~QDesktopWebView().
Andreas Kling
Comment 7
2011-08-22 04:21:30 PDT
Created
attachment 104663
[details]
Proposed patch v3 D'oh. Fixed a last-minute bug when QDesktopWebView is not at (0,0) in the scene. We shouldn't include the item position in the rect passed to updateTexturedRectGeometry().
Jocelyn Turcotte
Comment 8
2011-08-22 04:57:20 PDT
Comment on
attachment 104663
[details]
Proposed patch v3 View in context:
https://bugs.webkit.org/attachment.cgi?id=104663&action=review
> Source/WebKit2/UIProcess/API/qt/qdesktopwebview.cpp:249 > QDesktopWebView::~QDesktopWebView() > { > + delete d->material.texture();
Textures should only be destroyed on the SG thread. Their destructor calls glDeleteTextures and the SG thread might still use it in rendering right after the GUI thread deleted it. It's a bit annoying to handle ownership of those and I'm starting to think that QSGTextureMaterial should have some OwnsTexture flag like QSGNode have for materials.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug