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

Unified Diff: chrome/browser/renderer_host/render_widget_host.cc

Issue 3834003: On Windows, create a new TransportDIB::Handle struct which includes the file (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Rebase Created 10 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/renderer_host/render_widget_host.cc
diff --git a/chrome/browser/renderer_host/render_widget_host.cc b/chrome/browser/renderer_host/render_widget_host.cc
index a6efd58ae1847174aec14d0b9229276878560dfa..bf98b7dea0d499503403baa0f7e8b1fc9299b62c 100644
--- a/chrome/browser/renderer_host/render_widget_host.cc
+++ b/chrome/browser/renderer_host/render_widget_host.cc
@@ -763,6 +763,7 @@ void RenderWidgetHost::OnMsgPaintAtSizeAck(int tag, const gfx::Size& size) {
void RenderWidgetHost::OnMsgUpdateRect(
const ViewHostMsg_UpdateRect_Params& params) {
+ TransportDIB::ScopedHandle dib_handle(params.dib_handle);
TimeTicks paint_start = TimeTicks::Now();
if (paint_observer_.get())
@@ -797,7 +798,8 @@ void RenderWidgetHost::OnMsgUpdateRect(
if (!is_gpu_rendering_active_) {
const size_t size = params.bitmap_rect.height() *
params.bitmap_rect.width() * 4;
- TransportDIB* dib = process_->GetTransportDIB(params.bitmap);
+ TransportDIB* dib = process_->GetTransportDIB(params.dib_id,
+ dib_handle.release());
// If gpu process does painting, scroll_rect and copy_rects are always empty
// and backing store is never used.
@@ -816,8 +818,11 @@ void RenderWidgetHost::OnMsgUpdateRect(
// Paint the backing store. This will update it with the
// renderer-supplied bits. The view will read out of the backing store
// later to actually draw to the screen.
- PaintBackingStoreRect(params.bitmap, params.bitmap_rect,
- params.copy_rects, params.view_size,
+ PaintBackingStoreRect(params.dib_id,
+ params.dib_handle,
+ params.bitmap_rect,
+ params.copy_rects,
+ params.view_size,
&painted_synchronously);
}
}
@@ -881,9 +886,10 @@ void RenderWidgetHost::OnMsgCreateVideo(const gfx::Size& size) {
Send(new ViewMsg_CreateVideo_ACK(routing_id_, -1));
}
-void RenderWidgetHost::OnMsgUpdateVideo(TransportDIB::Id bitmap,
+void RenderWidgetHost::OnMsgUpdateVideo(TransportDIB::Id dib_id,
+ TransportDIB::Handle dib_handle,
const gfx::Rect& bitmap_rect) {
- PaintVideoLayer(bitmap, bitmap_rect);
+ PaintVideoLayer(dib_id, dib_handle, bitmap_rect);
// TODO(scherkus): support actual video ids!
Send(new ViewMsg_UpdateVideo_ACK(routing_id_, -1));
@@ -1049,9 +1055,10 @@ void RenderWidgetHost::OnAcceleratedSurfaceSetTransportDIB(
int32 width,
int32 height,
TransportDIB::Handle transport_dib) {
+ TransportDIB::ScopedHandle scoped_dib_handle(transport_dib);
if (view_) {
view_->AcceleratedSurfaceSetTransportDIB(window, width, height,
- transport_dib);
+ scoped_dib_handle.release());
}
}
@@ -1085,7 +1092,8 @@ void RenderWidgetHost::OnMsgDestroyPluginContainer(gfx::PluginWindowHandle id) {
#endif
void RenderWidgetHost::PaintBackingStoreRect(
- TransportDIB::Id bitmap,
+ TransportDIB::Id dib_id,
+ TransportDIB::Handle dib_handle,
const gfx::Rect& bitmap_rect,
const std::vector<gfx::Rect>& copy_rects,
const gfx::Size& view_size,
@@ -1107,8 +1115,13 @@ void RenderWidgetHost::PaintBackingStoreRect(
}
bool needs_full_paint = false;
- BackingStoreManager::PrepareBackingStore(this, view_size, bitmap, bitmap_rect,
- copy_rects, &needs_full_paint,
+ BackingStoreManager::PrepareBackingStore(this,
+ view_size,
+ dib_id,
+ dib_handle,
+ bitmap_rect,
+ copy_rects,
+ &needs_full_paint,
painted_synchronously);
if (needs_full_paint) {
repaint_start_time_ = TimeTicks::Now();
@@ -1137,12 +1150,13 @@ void RenderWidgetHost::ScrollBackingStoreRect(int dx, int dy,
backing_store->ScrollBackingStore(dx, dy, clip_rect, view_size);
}
-void RenderWidgetHost::PaintVideoLayer(TransportDIB::Id bitmap,
+void RenderWidgetHost::PaintVideoLayer(TransportDIB::Id dib_id,
+ TransportDIB::Handle dib_handle,
const gfx::Rect& bitmap_rect) {
if (is_hidden_ || !video_layer_.get())
return;
- video_layer_->CopyTransportDIB(process(), bitmap, bitmap_rect);
+ video_layer_->CopyTransportDIB(process(), dib_id, dib_handle, bitmap_rect);
// Don't update the view if we're hidden or if the view has been destroyed.
if (is_hidden_ || !view_)

Powered by Google App Engine
This is Rietveld 408576698