Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(377)

Issue 12881005: Allow CopyFromBackingStore to fallback to copying from the renderer side if the accelerated surface… (Closed)

Created:
7 years, 9 months ago by justinlin
Modified:
7 years, 8 months ago
CC:
chromium-reviews, yusukes+watch_chromium.org, feature-media-reviews_chromium.org, jam, penghuang+watch_chromium.org, joi+watch-content_chromium.org, Aaron Boodman, darin-cc_chromium.org, chromium-apps-reviews_chromium.org, James Su
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Visibility:
Public.

Description

Add RenderWidgetHost::GetSnapshotFromRenderer method to content/ interface for snapshotting for cases where we might not be able to use CopyFromBackingStore because the browser side can't access the backing store or accelerated surface due to driver issues or WinXP. Consolidate renderer-side snapshotting into that method and move clients (tabsApi, tabCapture and NTP) to the new method. Let the Linux CopyFromCompositingSurface always use this since the current one is incorrect if the tab is in the background or is covered by a window. Remove Linux-GTK snapshotting workarounds. BUG=188867, 174957, 132301 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=189969

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : reduce scope #

Patch Set 4 : #

Total comments: 2

Patch Set 5 : #

Total comments: 3

Patch Set 6 : fallback to renderer side copy when backing store is not avilable too #

Total comments: 1

Patch Set 7 : Change public interface instead #

Total comments: 2

Patch Set 8 : more deletes #

Total comments: 1

Patch Set 9 : indent #

Total comments: 2

Patch Set 10 : remove resize, make sure hidpi works #

Patch Set 11 : Move to RenderViewHost #

Patch Set 12 : Use same mechanism as render_widget for painting #

Patch Set 13 : uma #

Total comments: 2

Patch Set 14 : comments; sync up #

Total comments: 2

Patch Set 15 : #

Total comments: 1

Patch Set 16 : comments #

Patch Set 17 : unused include #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+170 lines, -274 lines) Patch
M chrome/browser/extensions/api/tabs/tabs_api.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +7 lines, -6 lines 0 comments Download
M chrome/browser/extensions/api/tabs/tabs_api.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +24 lines, -24 lines 0 comments Download
M chrome/browser/thumbnails/thumbnail_tab_helper.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +16 lines, -15 lines 0 comments Download
M chrome/browser/ui/browser_tab_contents.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +0 lines, -2 lines 0 comments Download
D chrome/browser/ui/snapshot_tab_helper.h View 3 4 1 chunk +0 lines, -38 lines 0 comments Download
D chrome/browser/ui/snapshot_tab_helper.cc View 3 4 1 chunk +0 lines, -47 lines 0 comments Download
M chrome/chrome_browser_ui.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +0 lines, -2 lines 0 comments Download
M chrome/common/chrome_content_client.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +0 lines, -6 lines 0 comments Download
M chrome/common/render_messages.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +0 lines, -8 lines 0 comments Download
M chrome/renderer/chrome_render_view_observer.h View 1 2 3 4 5 6 7 2 chunks +0 lines, -5 lines 0 comments Download
M chrome/renderer/chrome_render_view_observer.cc View 1 2 3 4 5 6 7 3 chunks +0 lines, -48 lines 0 comments Download
M content/browser/renderer_host/media/web_contents_video_capture_device.cc View 1 2 3 4 5 6 7 8 9 11 1 chunk +9 lines, -1 line 0 comments Download
M content/browser/renderer_host/render_widget_host_impl.h View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +8 lines, -0 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +37 lines, -2 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_view_gtk.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +3 lines, -41 lines 0 comments Download
M content/browser/web_contents/web_contents_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +0 lines, -29 lines 0 comments Download
M content/common/view_messages.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +8 lines, -0 lines 1 comment Download
M content/public/browser/render_widget_host.h View 1 2 3 4 5 6 7 8 9 11 1 chunk +10 lines, -0 lines 0 comments Download
M content/renderer/render_widget.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +3 lines, -0 lines 0 comments Download
M content/renderer/render_widget.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +45 lines, -0 lines 0 comments Download

Messages

Total messages: 39 (0 generated)
justinlin
Hi reviewers, ptal. I think maybe platform-specific CopyFromCompositingSurface implementations should be able to fallback to ...
7 years, 9 months ago (2013-03-15 06:19:15 UTC) #1
Alpha Left Google
I'm confused by this change. It seems to me this change tries to ask the ...
7 years, 9 months ago (2013-03-15 06:35:59 UTC) #2
justinlin
SnapshotTabHelper would need to be moved to content/ for us to use it. I started ...
7 years, 9 months ago (2013-03-15 06:43:47 UTC) #3
justinlin
Cleaned up some things and reduced scope of this. Will do deletions in separate CL. ...
7 years, 9 months ago (2013-03-16 02:24:22 UTC) #4
justinlin
I mean c/b/renderer_host/render_widget_host_view_*
7 years, 9 months ago (2013-03-16 02:27:08 UTC) #5
jamesr
https://codereview.chromium.org/12881005/diff/9009/content/common/view_messages.h File content/common/view_messages.h (right): https://codereview.chromium.org/12881005/diff/9009/content/common/view_messages.h#newcode1389 content/common/view_messages.h:1389: // Sent from the browser to ask the renderer ...
7 years, 9 months ago (2013-03-18 01:32:19 UTC) #6
justinlin
https://codereview.chromium.org/12881005/diff/9009/content/common/view_messages.h File content/common/view_messages.h (right): https://codereview.chromium.org/12881005/diff/9009/content/common/view_messages.h#newcode1389 content/common/view_messages.h:1389: // Sent from the browser to ask the renderer ...
7 years, 9 months ago (2013-03-18 03:21:14 UTC) #7
jamesr
On 2013/03/18 03:21:14, justinlin wrote: > https://codereview.chromium.org/12881005/diff/9009/content/common/view_messages.h > File content/common/view_messages.h (right): > > https://codereview.chromium.org/12881005/diff/9009/content/common/view_messages.h#newcode1389 > ...
7 years, 9 months ago (2013-03-18 03:49:20 UTC) #8
justinlin
OK, I put back the deletions into this CL and the tests seem to pass. ...
7 years, 9 months ago (2013-03-18 07:45:11 UTC) #9
Sam Kerner (Chrome)
https://codereview.chromium.org/12881005/diff/31001/chrome/browser/extensions/api/tabs/tabs_api.cc File chrome/browser/extensions/api/tabs/tabs_api.cc (right): https://codereview.chromium.org/12881005/diff/31001/chrome/browser/extensions/api/tabs/tabs_api.cc#newcode1753 chrome/browser/extensions/api/tabs/tabs_api.cc:1753: SendResultFromBitmap(bitmap); It has been a while since I was ...
7 years, 9 months ago (2013-03-18 13:49:51 UTC) #10
justinlin
Thanks, I did the experiment of continuously nuking the backing store via BackingStoreManager::RemoveAllBackingStores() (which looks ...
7 years, 9 months ago (2013-03-18 18:10:01 UTC) #11
Sam Kerner (Chrome)
https://codereview.chromium.org/12881005/diff/35001/content/browser/renderer_host/render_widget_host_impl.cc File content/browser/renderer_host/render_widget_host_impl.cc (right): https://codereview.chromium.org/12881005/diff/35001/content/browser/renderer_host/render_widget_host_impl.cc#newcode589 content/browser/renderer_host/render_widget_host_impl.cc:589: GetSnapshotFromRenderer(accelerated_copy_rect, You are changing the semantics of this method ...
7 years, 9 months ago (2013-03-18 19:30:52 UTC) #12
justinlin
OK, how about: just add GetSnapshotFromRenderer() to the RenderWidgetHost public interface? And, I'll undo all ...
7 years, 9 months ago (2013-03-18 21:07:59 UTC) #13
justinlin
Made the changes, ptal.
7 years, 9 months ago (2013-03-18 21:40:34 UTC) #14
Sam Kerner (Chrome)
On 2013/03/18 21:40:34, justinlin wrote: > Made the changes, ptal. LGTM for extension code. I ...
7 years, 9 months ago (2013-03-18 22:08:32 UTC) #15
Sam Kerner (Chrome)
https://codereview.chromium.org/12881005/diff/46001/chrome/browser/extensions/api/tabs/tabs_api.cc File chrome/browser/extensions/api/tabs/tabs_api.cc (right): https://codereview.chromium.org/12881005/diff/46001/chrome/browser/extensions/api/tabs/tabs_api.cc#newcode1754 chrome/browser/extensions/api/tabs/tabs_api.cc:1754: SendInternalError(); Indent should be two spaces.
7 years, 9 months ago (2013-03-18 22:08:46 UTC) #16
jamesr
Is the code you are adding used for NTP thumbnails? The resizing logic for those ...
7 years, 9 months ago (2013-03-18 22:41:18 UTC) #17
jamesr
I'm thinking about chrome/browser/thumbnails/render_widget_snapshot_taker.cc
7 years, 9 months ago (2013-03-18 22:44:01 UTC) #18
justinlin
No, as far as I could tell, the only thing that used the renderer-side snapshot ...
7 years, 9 months ago (2013-03-18 23:27:51 UTC) #19
jamesr
On 2013/03/18 23:27:51, justinlin wrote: > No, as far as I could tell, the only ...
7 years, 9 months ago (2013-03-18 23:57:22 UTC) #20
justinlin
(Note: just realized the method I added is not in the right place: it should ...
7 years, 9 months ago (2013-03-19 09:42:12 UTC) #21
justinlin
So, in other words: the chrome.tabs.getCapturedTabs API and the tabCapture API will now share pretty ...
7 years, 9 months ago (2013-03-19 19:58:45 UTC) #22
jamesr
On 2013/03/19 19:58:45, justinlin wrote: > So, in other words: the chrome.tabs.getCapturedTabs API and the ...
7 years, 9 months ago (2013-03-19 20:01:13 UTC) #23
justinlin
On 2013/03/19 20:01:13, jamesr wrote: > On 2013/03/19 19:58:45, justinlin wrote: > > So, in ...
7 years, 9 months ago (2013-03-19 20:09:41 UTC) #24
jamesr
On 2013/03/19 20:09:41, justinlin wrote: > On 2013/03/19 20:01:13, jamesr wrote: > > On 2013/03/19 ...
7 years, 9 months ago (2013-03-19 20:14:47 UTC) #25
justinlin
On 2013/03/19 20:14:47, jamesr wrote: > On 2013/03/19 20:09:41, justinlin wrote: > > On 2013/03/19 ...
7 years, 9 months ago (2013-03-19 20:36:48 UTC) #26
justinlin
So, I changed GetSnapshotFromRenderer to operate on WebWidgets exactly like render_widget_snapshot_taker (I looked through the ...
7 years, 9 months ago (2013-03-20 23:13:55 UTC) #27
justinlin
+mazda: ptal @ render_widget_host_view_gtk.cc; this is better than the current implementation because currently capturing background ...
7 years, 9 months ago (2013-03-21 00:33:51 UTC) #28
jamesr
This looks really nice. I'm only very familiar with the */renderer/* systems, but the IPCs ...
7 years, 9 months ago (2013-03-22 00:05:33 UTC) #29
justinlin
thanks! ptal jam@: ptal for content/ interface changes mazda@: ping for linux change https://codereview.chromium.org/12881005/diff/76051/content/renderer/render_widget.cc File ...
7 years, 9 months ago (2013-03-22 00:43:39 UTC) #30
mazda
render_widget_host_view_gtk.cc lgtm https://codereview.chromium.org/12881005/diff/6002/content/browser/renderer_host/render_widget_host_view_gtk.cc File content/browser/renderer_host/render_widget_host_view_gtk.cc (left): https://codereview.chromium.org/12881005/diff/6002/content/browser/renderer_host/render_widget_host_view_gtk.cc#oldcode1048 content/browser/renderer_host/render_widget_host_view_gtk.cc:1048: // NOTE: |output| is initialized with the ...
7 years, 9 months ago (2013-03-22 00:51:29 UTC) #31
justinlin
https://codereview.chromium.org/12881005/diff/6002/content/browser/renderer_host/render_widget_host_view_gtk.cc File content/browser/renderer_host/render_widget_host_view_gtk.cc (left): https://codereview.chromium.org/12881005/diff/6002/content/browser/renderer_host/render_widget_host_view_gtk.cc#oldcode1048 content/browser/renderer_host/render_widget_host_view_gtk.cc:1048: // NOTE: |output| is initialized with the size of ...
7 years, 9 months ago (2013-03-22 00:57:21 UTC) #32
Avi (use Gerrit)
I'm super excited to see consolidation and cleanup of the snapshotting code. I've done no ...
7 years, 9 months ago (2013-03-22 18:21:21 UTC) #33
justinlin
thanks! sky@: ptal for OWNERS approval for the chrome/ changes? it's mostly just deletions except ...
7 years, 9 months ago (2013-03-22 18:40:03 UTC) #34
sky
LGTM https://codereview.chromium.org/12881005/diff/103003/chrome/browser/extensions/api/tabs/tabs_api.h File chrome/browser/extensions/api/tabs/tabs_api.h (right): https://codereview.chromium.org/12881005/diff/103003/chrome/browser/extensions/api/tabs/tabs_api.h#newcode198 chrome/browser/extensions/api/tabs/tabs_api.h:198: void GetSnapshotFromRendererComplete(bool succeeded, Add descriptions for these methods.
7 years, 9 months ago (2013-03-22 19:39:22 UTC) #35
Cris Neckar
IPC changes LGTM filed https://code.google.com/p/chromium/issues/detail?id=223284 for a prexisting bug but this CL seems to actually ...
7 years, 9 months ago (2013-03-22 22:45:24 UTC) #36
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/justinlin@chromium.org/12881005/119001
7 years, 9 months ago (2013-03-22 23:28:26 UTC) #37
justinlin
Committed patchset #17 manually as r189969 (presubmit successful).
7 years, 9 months ago (2013-03-23 01:50:27 UTC) #38
jam
7 years, 8 months ago (2013-04-22 19:59:52 UTC) #39
Message was sent while issue was closed.
https://codereview.chromium.org/12881005/diff/119001/content/common/view_mess...
File content/common/view_messages.h (right):

https://codereview.chromium.org/12881005/diff/119001/content/common/view_mess...
content/common/view_messages.h:1393: IPC_MESSAGE_ROUTED2(ViewHostMsg_Snapshot,
nit: i just saw this. this second IPC is in the wrong place, see how the file
puts all the ViewMsg_* messages first, then all the ViewHostMsg_*

Powered by Google App Engine
This is Rietveld 408576698