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

Side by Side Diff: chrome/renderer/render_widget.cc

Issue 4815001: Use inner HWND for accelerated rendering on windows (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/renderer/render_widget.h" 5 #include "chrome/renderer/render_widget.h"
6 6
7 #include "app/surface/transport_dib.h" 7 #include "app/surface/transport_dib.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after
516 copy_rects.swap(update.paint_rects); 516 copy_rects.swap(update.paint_rects);
517 if (!scroll_damage.IsEmpty()) 517 if (!scroll_damage.IsEmpty())
518 copy_rects.push_back(scroll_damage); 518 copy_rects.push_back(scroll_damage);
519 519
520 for (size_t i = 0; i < copy_rects.size(); ++i) 520 for (size_t i = 0; i < copy_rects.size(); ++i)
521 PaintRect(copy_rects[i], bounds.origin(), canvas.get()); 521 PaintRect(copy_rects[i], bounds.origin(), canvas.get());
522 522
523 dib_id = current_paint_buf_->id(); 523 dib_id = current_paint_buf_->id();
524 } else { // Accelerated compositing path 524 } else { // Accelerated compositing path
525 // Begin painting. 525 // Begin painting.
526 bool finish = next_paint_is_resize_ack(); 526 webwidget_->composite(false);
527 webwidget_->composite(finish);
528 } 527 }
529 528
530 // sending an ack to browser process that the paint is complete... 529 // sending an ack to browser process that the paint is complete...
531 ViewHostMsg_UpdateRect_Params params; 530 ViewHostMsg_UpdateRect_Params params;
532 params.bitmap = dib_id; 531 params.bitmap = dib_id;
533 params.bitmap_rect = bounds; 532 params.bitmap_rect = bounds;
534 params.dx = update.scroll_delta.x(); 533 params.dx = update.scroll_delta.x();
535 params.dy = update.scroll_delta.y(); 534 params.dy = update.scroll_delta.y();
536 if (is_accelerated_compositing_active_) { 535 if (is_accelerated_compositing_active_) {
537 // If painting is done via the gpu process then we clear out all damage 536 // If painting is done via the gpu process then we clear out all damage
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
621 // 1) Ensures that we call WebView::Paint without a bunch of other junk 620 // 1) Ensures that we call WebView::Paint without a bunch of other junk
622 // on the call stack. 621 // on the call stack.
623 // 2) Allows us to collect more damage rects before painting to help coalesce 622 // 2) Allows us to collect more damage rects before painting to help coalesce
624 // the work that we will need to do. 623 // the work that we will need to do.
625 MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod( 624 MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod(
626 this, &RenderWidget::CallDoDeferredUpdate)); 625 this, &RenderWidget::CallDoDeferredUpdate));
627 } 626 }
628 627
629 void RenderWidget::didActivateAcceleratedCompositing(bool active) { 628 void RenderWidget::didActivateAcceleratedCompositing(bool active) {
630 is_accelerated_compositing_active_ = active; 629 is_accelerated_compositing_active_ = active;
631 Send(new ViewHostMsg_GpuRenderingActivated( 630 Send(new ViewHostMsg_DidActivateAcceleratedCompositing(
632 routing_id_, is_accelerated_compositing_active_)); 631 routing_id_, is_accelerated_compositing_active_));
633 } 632 }
634 633
635 void RenderWidget::scheduleComposite() { 634 void RenderWidget::scheduleComposite() {
636 // TODO(nduca): replace with something a little less hacky. The reason this 635 // TODO(nduca): replace with something a little less hacky. The reason this
637 // hack is still used is because the Invalidate-DoDeferredUpdate loop 636 // hack is still used is because the Invalidate-DoDeferredUpdate loop
638 // contains a lot of host-renderer synchronization logic that is still 637 // contains a lot of host-renderer synchronization logic that is still
639 // important for the accelerated compositing case. The option of simply 638 // important for the accelerated compositing case. The option of simply
640 // duplicating all that code is less desirable than "faking out" the 639 // duplicating all that code is less desirable than "faking out" the
641 // invalidation path using a magical damage rect. 640 // invalidation path using a magical damage rect.
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
982 981
983 void RenderWidget::CleanupWindowInPluginMoves(gfx::PluginWindowHandle window) { 982 void RenderWidget::CleanupWindowInPluginMoves(gfx::PluginWindowHandle window) {
984 for (WebPluginGeometryVector::iterator i = plugin_window_moves_.begin(); 983 for (WebPluginGeometryVector::iterator i = plugin_window_moves_.begin();
985 i != plugin_window_moves_.end(); ++i) { 984 i != plugin_window_moves_.end(); ++i) {
986 if (i->window == window) { 985 if (i->window == window) {
987 plugin_window_moves_.erase(i); 986 plugin_window_moves_.erase(i);
988 break; 987 break;
989 } 988 }
990 } 989 }
991 } 990 }
OLDNEW
« chrome/gpu/gpu_command_buffer_stub.cc ('K') | « chrome/gpu/gpu_command_buffer_stub.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698