Closed magreenblatt closed 12 years ago
Original comment by Anonymous.
Comment 52. originally posted by google@dav1d.de on 2012-12-10T22:49:06.000Z:
@ comment comment 49.: that's unfortunate
If anyone can point me into the right direction to add off-screen rendering for linux, I could probably help. Any hints appreciated.
Original comment by Anonymous.
Comment 53. originally posted by Zhaojun.Meng on 2012-12-11T16:58:38.000Z:
Add a patch to support transparent background when off screen rendering.
CEF1 support transparent background when osr, because CEF1 called:
webviewhost_->webview()->setIsTransparent(true);
When using content, it's done by calling:
RenderWidgetHostImpl::SetBackground(), with a transparent bitmap.
Currently osr implement use StretchDIBits extracted from:
content/browser/renderer_host/backing_store_win.cc.
Which loss alpha channel(filled with value 0).
To apply alpha, I extract code from:
/content/browser/renderer_host/backing_store_aura.cc
to use SkBitmap and SkCanvas to implement backing store.
And it seems works not only on Windows.
Original comment by Anonymous.
Comment 54. originally posted by rosca@adobe.com on 2012-12-11T17:54:03.000Z:
@ comment comment 53.: thanks a lot, I used the same source
I'm attaching the patch with following changes:
1) Alpha issue
-- backing store using skia instead of GDI and keeping alpha values
-- transparent background is set up when calling SetTransparentPainting on CefWindowInfo
-- Should work for all platforms
2) Select popups
-- Added a new argument for Invalidate, telling browser to invalidate the select popup or the main view
-- cefclient demo for select popups
-- the hook for select popup creation is done through a patch in chromium content.
To be done:
-- contribute patch content_popups.patch to http://code.google.com/p/chromium/issues/detail?id=155761
-- unit tests for alpha blending and select popups
Original comment by Anonymous.
Comment 55. originally posted by rosca@adobe.com on 2012-12-17T22:57:23.000Z:
osr5.patch contains osr4.path and
-- unit test for transparent painting
-- unit tests for select popups
-- mouse event methods will take modifiers as an argument
Original comment by Anonymous.
Comment 56. originally posted by a.dionisi@shinyweb.it on 2012-12-18T23:55:39.000Z:
Thanksssss!! :D
Original comment by Anonymous.
Comment 57. originally posted by acron1 on 2013-01-04T09:52:25.000Z:
A release with OSR would be really, really awesome.. :) Pretty please?
Comment 58. originally posted by magreenblatt on 2013-01-04T11:01:36.000Z:
@ commentscomment 53.-55: Thanks for the patches. Some comments related to osr5.patch, which overall looks quite good:
///
// Send a key event to the browser.
The SendKeyEvent, SendMouseClickEvent, SendMouseMoveEvent and SendMouseWheelEvent might also be used with a windowed browser for automated testing purposes. It would be nice to continue to support these methods for that use case. Perhaps either keep the PlatformTranslate* methods in CefBrowserHostImpl or move them to a new shared location instead of moving them to RenderWidgetHostViewOSR. RenderWidgetHostViewOSR could then perform the globalX/globalY transformation after calling the PlatformTranslate* method. Also, the PlatformTranslate* methods are still platform-specific so the implementations should be in a platform-specific source file.
Is it now a requirement that GetRootScreenRect always be implemented? If so, please update the GetRootScreenRect comments in cef_render_handler.h.
Consider moving this code to a helper instead of duplicating it in SendMouseClickEvent, SendMouseMoveEvent and SendMouseWheelEvent.
There seems to a problem computing the bounds for select popups. Currently, if you scroll so that the popup is at the bottom of the page it will show the popup below the control and clipped. Instead, it should show the popup above the control.
We should add a new command-line flag to enable transparent off-screen rendering in cefclient for testing purposes.
Original comment by Anonymous.
Comment 59. originally posted by iohanson on 2013-01-07T16:53:15.000Z:
@ commentcomment 56.: Thanks for comments.
I have attached osr6.patch with addressed comments. This patch also contains the fix for http://code.google.com/p/chromiumembedded/issues/detail?id=826
Original comment by Anonymous.
Comment 60. originally posted by tuolin on 2013-01-08T07:47:14.000Z:
@ commentcomment 59. The content_popups.patch file seems to be missing from the patch.
Original comment by Anonymous.
Comment 61. originally posted by iohanson on 2013-01-08T08:11:56.000Z:
@ commentcomment 60. Thanks, attached again
Original comment by Anonymous.
Comment 62. originally posted by rosca@adobe.com on 2013-01-10T22:30:14.000Z:
The chromium bug regarding popup widget creation (http://code.google.com/p/chromium/issues/detail?id=155761) has been fixed. The changes got submitted with revision 176092 (bb) (http://src.chromium.org/viewvc/chrome?view=rev&revision=176092).
Comment 63. originally posted by magreenblatt on 2013-01-11T18:17:18.000Z:
issue #826 has been merged into this issue.
Comment 64. originally posted by magreenblatt on 2013-01-11T23:02:28.000Z:
@ commentcomment 61.: Thanks, I've committed your patch as revision 979 with the following changes:
A. Added a fix for comment 1. below.
B. Brought over the transparency.html test from CEF1 and added a "Transparency" item to the Tests menu.
C. Fixed the cefclient rotation effect to work even when the underlying web content is not updating.
D. Various minor style and documentation changes.
A few comments:
We should implicitly disable accelerated compositing in CefBrowserHost::CreateBrowser and CreateBrowserSync instead of requiring the client to explicitly disable it whenever off-screen rendering is used.
Original comment by Anonymous.
Comment 65. originally posted by olaru@adobe.com on 2013-01-17T17:17:33.000Z:
Hi,
I am attaching a first patch for OSR on Mac for feeback. I will work on adapting the unit tests, but thought I could receive some feedback in the meantime.
This patch has:
To be done:
Thanks
Original comment by Anonymous.
Comment 66. originally posted by nvineeth on 2013-01-24T09:08:32.000Z:
@ commentcomment 65.:
In browser_host_impl_mac.mm I think the following change should be done in PlatformGetWindowHandle:
CefWindowHandle CefBrowserHostImpl::PlatformGetWindowHandle() {
return IsWindowRenderingDisabled() ?
window_info_.parent_view:
window_info_.view;
}
Original comment by Anonymous.
Comment 67. originally posted by dreijerbit on 2013-01-24T17:52:25.000Z:
Has anybody tried using Flash with the latest OSR support on Windows? I'm unable to get the Flash plugin to render anything (e.g YouTube).
Original comment by Anonymous.
Comment 68. originally posted by olaru@adobe.com on 2013-01-24T18:12:04.000Z:
@ 67
I did some quick testing before, and:
YouTube uses wmode window, IIRC.
Original comment by Anonymous.
Comment 69. originally posted by dreijerbit on 2013-01-24T18:41:23.000Z:
comment 68.: Aha, that would explain it! Does anybody with knowledge of the Content API know how to fix this? So far, everything else has been working great (ordinary rendering, popups, etc.), so proper Flash support is about the only thing left for me in order to use CEF3 in a production build.
Comment 70. originally posted by magreenblatt on 2013-01-24T18:44:15.000Z:
@ commentcomment 69.: We fixed plugin rendering in CEF1 by forcing Flash and Silverlight plugins to use windowless mode. Here's the related issue: http://code.google.com/p/chromiumembedded/issues/detail?id=214
Comment 71. originally posted by magreenblatt on 2013-01-24T19:40:11.000Z:
@ commentcomment 65.:
- There is some code commented out in the v8 unit tests, because it did not compile
on Mac - this should be fixed properly
This should be fixed in the current trunk.
- There are some changes in url_request_context_proxy.cc to address a crash when running
OSR unit tests, and there might be a cleaner way to fix it.
Please file a separate issue for this.
And, some comments related to your patch:
You can leave out the auto-generated files. That makes it easier to see the important changes.
+typedef struct _cef_screen_info_t {
Does the user need the ability to customize all of the values in this structure or can we leave some of them out? What happens if the user specifies strange values, or if they return false from GetScreenInfo()? Maybe returning false should cause it to use reasonable default values?
The variable is now called |parent_view|.
void CefBrowserHostImpl::PlatformTranslateKeyEvent(
Too much indentation. Should be 4 spaces.
Check if GetClient() or GetRenderHandler() return NULL.
|view| may be NULL.
Typo.
I guess that's just the way [NSMenu popUpContextMenu] works?
It's eventually returned via content::WebContentsDelegate::HandleContextMenu. The comment on that method says: "Returns true if the context menu operation was handled by the delegate."
Yes, if a parent view is provided (it may be NULL).
+#if defined(OS_MACOSX)
+// Called just before GetBackingStore blocks for an updated frame.
+void CefRenderWidgetHostViewOSR::AboutToWaitForBackingStoreMsg() {
These DLOG(INFO)s are probably just for your development, but they should be removed from the final version of the patch. Also, no need to duplicate comments from the parent class.
Don't duplicate comments from the parent class.
Something wrong with the indentation here.
And here.
+bool ClientOSRHandler::GetScreenPoint(CefRefPtr
And here.
+CefRect convertRect(const NSRect& target, const NSRect& frame) {
Put global functions in an anonymous namespace or make them static.
Open bracket goes on the previous line.
Will you fix this in your updated patch?
+#if defined(OS_MACOSX)
+#if !defined(RGB)
Don't indent preprocessor directives.
+#else
+#error
+#endif
Add a message to the #error directive (like "Unsupported platform").
Better to use 1U instead of (size_t)1. We'll eventually make this change in other files as well.
Use 0x7f7f0000U instead of static_cast
Don't indent preprocessor directives.
Original comment by Anonymous.
Comment 72. originally posted by nvineeth on 2013-01-26T08:13:46.000Z:
@ commentcomment 65.:
http://code.google.com/p/chromiumembedded/issues/attachmentText?id=518&aid=5180065000&name=osr\_mac1.patch&token=XXgRI-PFlIFqDbEEWdNfv9PC4YQ%3A1359177777718comment 20.85
Shouldn't the |mouseUp| parameter be true, since the button is Up? Also changing this to true does not select the text when double clicked. On Windows, when this param is true, the double clicked test area is selected. Similarly pls check for other buttons as well.
Original comment by Anonymous.
Comment 73. originally posted by nvineeth on 2013-01-30T09:22:25.000Z:
@ Commentcomment 72.
In r980 win also the param should be false for selection to happen on dbl click . My observation for Windows is not correct above.
Original comment by Anonymous.
Comment 74. originally posted by olaru@adobe.com on 2013-02-06T17:59:53.000Z:
@ 71 Thanks for the comments Marshall. What is not mentioned below should be addressed in the patch.
- There are some changes in url_request_context_proxy.cc to address a crash when running
OSR unit tests, and there might be a cleaner way to fix it.Please file a separate issue for this.
I have added a ContextMenu test to the OSR unit tests, because I have not been able to reproduce the issue any other way. I assume to reproduce this would require some messing around with bot the UI and the API - show context menu, the destroy the browser. I will add the assert stack trace to the bug.
I can remove the workaround code from url_request_context_proxy.cc, but the unit tests will crash on the ContextMenu test.
On Windows, it does not crash, but leaves the menu on screen, and prevents the unit tests from exiting. Clicking on ViewSource will crash the unit tests.
+typedef struct _cef_screen_info_t {
Does the user need the ability to customize all of the values in this structure or can we leave some of them out?
It's worth noting that right now, the GetScreenInfo function is only called from content on Posix systems. It would be desirable for it to be called on Windows as well, but this will require a small patch to Chromium in RenderWidgetHostImpl::GetWebScreenInfo.
If you're asking whether we can make the structure simpler, I think so, yes. The content code seems to only access the device scale factor, and the rest is passed into WebKit. I haven't seen visible effects from modifying the other values, but I might be missing something, and not testing the appropriate use cases.
The defaults will be used if the client does not provide the information.
What happens if the user specifies strange values, or if they return false from GetScreenInfo()? Maybe returning false should cause it to use reasonable default values?
Defaults are used when returning false. I'm not sure about strange values though.
- GetClient()->GetRenderHandler()->GetScreenPoint(GetBrowser(),
Check if GetClient() or GetRenderHandler() return NULL.
When window rendering is disabled, CreateBrowser checks that the client and render handler are not NULL, so the checks are not needed. I've also removed similar checks from the other implemented functions.
- // FIXME: This logic fails if the user presses both Shift keys at once, for
- // example: we treat releasing one of them as keyDown.
Will you fix this in your updated patch?
The osrtest files were initially taken from the CEF1 OSR test implementation, along with this code and comment. The original code (and comment) seems to be taken from WebKit, where it is duplicated in a number of files (third_party/WebKit/Source/WebKit/chromium/src/mac/WebInputEventFactory.mm). It is not fixed in any of them, and it probably involves holding a state of all modifier keys, which may not be worth the effort for a test application.
There is still an issue with transparency in cefclient, but it seems to happen only on HiDPI. There are artifacts when resizing the client window, as well as in some other use cases. When moving to a non-hidpi screen, the artifacts do not appear. I am investigating this issue.
Some notes about the unit tests:
Original comment by Anonymous.
Comment 75. originally posted by olaru@adobe.com on 2013-02-12T12:13:13.000Z:
I've added a chromium bug and patch for the transparency issue:
https://code.google.com/p/chromium/issues/detail?id=175698
https://codereview.chromium.org/12249002/
I will create a Chromium patch in the mean time.
Original comment by Anonymous.
Comment 76. originally posted by olaru@adobe.com on 2013-02-19T11:37:37.000Z:
Added issue https://code.google.com/p/chromiumembedded/issues/detail?id=887 for the crash.
Original comment by Anonymous.
Comment 77. originally posted by olaru@adobe.com on 2013-02-21T16:39:57.000Z:
Adding a new version of OSR on Mac, with some fixes. This patch includes.
Original comment by Anonymous.
Comment 78. originally posted by olaru@adobe.com on 2013-02-21T18:03:12.000Z:
It appears that the GetScreenInfo Win changes in content.patch have already made their way into Chromium, before I could push for them myself.
Original comment by Anonymous.
Comment 79. originally posted by olaru@adobe.com on 2013-02-22T11:55:33.000Z:
It appears that my editor automatically trimmed the whitespace from the previous patch, and it does not apply correctly. This new version should fix things.
Comment 81. originally posted by magreenblatt on 2013-02-22T18:02:26.000Z:
@ commentcomment 78.: I'll be updating CEF to a newer Chromium version shortly.
@ commentcomment 79.: Thanks for the updated patch. Overall it looks good. Some comments:
When creating patch files please use `git diff --no-prefix` and don't include generated files (*_capi.h, *_cpptoc.cc, etc).
This syntax may fail with some compiler versions. Use assignment to the NSPoint members instead.
Use lower-case names ("osrtest") here and in other places for consistency with existing resource URLs.
Consider calling the argument something else (like |enabled|) so that we don't need to use |this| for the assignment.
And various style issues:
We use American spelling (color vs colour) for consistency.
+///
+// Class representing the virtual screen information for the offscreen
+// rendering screen
+///
Use proper punctuation (periods).
And here.
Wrong indentation. There's a lot of this in ClientOSRHandler as well.
+//#include "cefclient/client_popup_handler.h"
Delete this line.
Delete this line.
Delete this line.
Open bracket should be on the same line.
Original comment by Anonymous.
Comment 82. originally posted by olaru@adobe.com on 2013-02-25T22:36:42.000Z:
Thank you for the feedback Marshall.
I realized I mixed up the commanl lines when posting the osr_mac2.1 patches, and instead of libcef_dll, I excluded the libcef folder (completely). I also trickled in some of the popups patch code, which is now removed. This also explains 1.
The new patch is based on CEF r1107, and addresses the comments, but the libcef folder still needs reviewing.
2,3 - done
And various style issues:
2 - Done
3 and 6 are part of the popups implementation, so they no longer appear in the current patch. I will address them there.
5, 7, 8 - Done
Original comment by Anonymous.
Comment 83. originally posted by dreijerbit on 2013-02-28T23:24:36.000Z:
Has anybody else notified a graphical artifact when scrolling the browser by clicking the middle mouse button, moving the mouse, and then clicking the middle mouse button again? I'm seeing the "move cursor" stay on the screen after scrolling has finished.
Comment 84. originally posted by magreenblatt on 2013-02-28T23:28:23.000Z:
@ commentcomment 83.: This appears to be a bug in Chromium 25 and not specific to off-screen rendering. I'm experiencing it on some but not all websites with Chrome 25.0.1364.97 as well.
Comment 85. originally posted by magreenblatt on 2013-03-05T16:57:36.000Z:
issue #901 has been merged into this issue.
Comment 86. originally posted by magreenblatt on 2013-03-05T17:13:31.000Z:
@ commentcomment 82.: Overall looks good. Are there any other changes you'd like to include before this gets committed? Also, please update your patch to the current CEF trunk revision which uses Chromium revision 184577 (bb). Thanks.
Comment 87. originally posted by magreenblatt on 2013-03-05T17:17:11.000Z:
Original comment by Anonymous.
Comment 88. originally posted by olaru@adobe.com on 2013-03-07T17:45:33.000Z:
Attaching the osr_mac patch rebased on top of r1131. This patch should have nothing more to add, except for rebasing to the new revision.
I am also attaching a popups patch, wich applies on top of the code with the base osr_mac patch already applied. This is rather small, and does not modify a lot in terms of functionality:
The popups patch does not introduce major changes, but still needs to go through review, although it should be easier since the patch is smaller. If you think this can go in at the same time, all the better. If not, please go ahead withouth the second patch.
Comment 89. originally posted by magreenblatt on 2013-03-15T16:08:47.000Z:
@ commentcomment 88.: Thanks for the updated patches. Some comments about osr_mac_popups.patch:
Perhaps this check should fail if any of the width/height dimensions are 0?
bool rotating_;
Follow the style of the existing variable names.
+===================================================================
+--- render_thread_impl.cc (revision 184577 (bb))
++++ render_thread_impl.cc (working copy)
+@ @ -299,7 +299,7 @ @
What effect does this have on windowed mode usage? Perhaps we should instead toggle this value somewhere in the CEF code only after checking that we're using off-screen rendering?
Use a class variable instead so it doesn't break if someone creates multiple ClientOSRHandler instances in the future.
Original comment by Anonymous.
Comment 90. originally posted by askthegimp on 2013-03-16T22:39:34.000Z:
Hi, here's a chromium patch that enables flash and silverlight rendering in offscreen mode (only tested on windows). The patch is almost identical to http://code.google.com/p/chromiumembedded/issues/detail?id=527. It's a quick and dirty hack, just for a start. Actually it does not check wether we are rendering offscreen or not, so perhaps a better idea would be to do the work in cef3 where RenderViewImpl::createPlugin is invoked and where we have visibility to the internal cef settings/flags.
Original comment by Anonymous.
Comment 91. originally posted by dreijerbit on 2013-03-16T22:46:17.000Z:
comment 90.: Sweet. Progress on wmode support! :)
Quick question regarding the patch: You allow both opaque and transparent mode for Flash, but then you force it to opaque mode on line 53. Wouldn't it be better to let the value fall through all the way?
Original comment by Anonymous.
Comment 92. originally posted by askthegimp on 2013-03-17T00:07:29.000Z:
checkout line 32, it's a bit confusing, flash is set to false when wmode is transparent or opaque....
Original comment by Anonymous.
Comment 93. originally posted by dreijerbit on 2013-03-17T03:55:27.000Z:
comment 92.: Ah, right, you don't need to force anything if opaque and transparent are already set. Guess the naming of 'flash' (setting it to false is pretty misleading :) could probably be improved for readability, but that's up to Marshall to decide, I guess.
Excited to see this in trunk in some shape or form!
Original comment by Anonymous.
Comment 94. originally posted by feibao.lou on 2013-03-25T07:04:44.000Z:
I'm waiting for the feature that get webkit-transform CSS style rendered properly in OSR......
Original comment by Anonymous.
Comment 95. originally posted by rosca@adobe.com on 2013-03-25T09:18:10.000Z:
@ commentcomment 94. - What is the problem with webkit-transform in off-screen rendering? Please give more details. Are you referring to https://code.google.com/p/chromiumembedded/issues/detail?id=826?
Original comment by Anonymous.
Comment 96. originally posted by efrencd on 2013-03-25T11:45:17.000Z:
Is there any plan to eneable accelerated compositing in Off-Screen mode?
Original comment by Anonymous.
Comment 97. originally posted by askthegimp on 2013-03-27T15:31:25.000Z:
comment 91.: I just compiled the current trunk (r1161) with the flash/silverlight patch, if you want to try it you can download it from here: http://ytronix.com/cef3/
Original comment by Anonymous.
Comment 98. originally posted by feibao.lou on 2013-03-27T15:43:37.000Z:
@ commentcomment 95. yes, seems no good ways to render 3D transform effect in OSR mode now, in CEF3.
Comment 99. originally posted by magreenblatt on 2013-04-04T15:43:19.000Z:
@ commentcomment 88. (olaru@ adobe.com): Are you planning to update your patches in the near future? We're currently at the Chromium 27 branch point (revision 190564 (bb)) and it would be nice to have the OS-X support in that branch.
Original comment by Anonymous.
Comment 100. originally posted by horia.olaru on 2013-04-04T15:59:00.000Z:
@ commentcomment 99. Yes, I will update my patches in the near future.
I have one quick question on commentcomment 89. - issue #3. You are right. It will, of course, affect windowed rendering and I'll fix it. To set the handling of popup menus correctly, the Renderer needs to be aware of the offscreen rendering mode. I was thinking of creating a new setting, and passing it as a command line parameter when the renderer is created. Does that sound like a good way to go?
Original comment by Dmitry Azaraev (Bitbucket: Mystic Artifact).
Comment 101. originally posted by fddima on 2013-04-04T16:04:21.000Z:
@ commentcomment 10.0: (minor comment) so it is global setting, and both modes can't be mixed together? What happens if renderer limit reached and renderer process will be shared for host OSR browser and windowed browser inside?
Comment 102. originally posted by magreenblatt on 2013-04-04T16:10:12.000Z:
@ commentcomment 10.0: A command-line flag won't work because a windowed and windowless browser may theoretically share the same render process if they have the same origin, or if running in single-process mode. Consider adding a new member to the CefBrowserInfo class instead. The information is then sent to the render process via CefProcessHostMsg_GetNewBrowserInfo (CefContentRendererClient::RenderViewCreated and CefBrowserMessageFilter::OnGetNewBrowserInfo).
Original report by me.
Original issue 518 created by magreenblatt on 2012-02-13T19:15:26.000Z:
Add off-screen rendering support. See http://magpcss.org/ceforum/viewtopic.php?f=10&t=645 for CEF3 information.