summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/render_widget.cc
diff options
context:
space:
mode:
authormaruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-23 19:58:23 +0000
committermaruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-23 19:58:23 +0000
commitee0dc4f2b31dc1b4f9c555afe36c648d77217c93 (patch)
tree86484f2556f5875dbc104836eac76aaa55c8d203 /chrome/renderer/render_widget.cc
parent1d01ed634bd4a4e3c15d89931aad1bfc62e0b6cd (diff)
downloadchromium_src-ee0dc4f2b31dc1b4f9c555afe36c648d77217c93.zip
chromium_src-ee0dc4f2b31dc1b4f9c555afe36c648d77217c93.tar.gz
chromium_src-ee0dc4f2b31dc1b4f9c555afe36c648d77217c93.tar.bz2
Revert "Add some optimizations to plugin painting."
This reverts commit 60329. TBR=brettw BUG= TEST= Review URL: http://codereview.chromium.org/3442013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60331 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/render_widget.cc')
-rw-r--r--chrome/renderer/render_widget.cc27
1 files changed, 5 insertions, 22 deletions
diff --git a/chrome/renderer/render_widget.cc b/chrome/renderer/render_widget.cc
index 95346c3..3252097 100644
--- a/chrome/renderer/render_widget.cc
+++ b/chrome/renderer/render_widget.cc
@@ -505,21 +505,11 @@ void RenderWidget::DoDeferredUpdate() {
gfx::Rect scroll_damage = update.GetScrollDamage();
gfx::Rect bounds = update.GetPaintBounds().Union(scroll_damage);
- // A plugin may be able to do an optimized paint. First check this, in which
- // case we can skip all of the bitmap generation and regular paint code.
- TransportDIB::Id dib_id;
- TransportDIB* dib = NULL;
std::vector<gfx::Rect> copy_rects;
- if (update.scroll_rect.IsEmpty() &&
- !is_gpu_rendering_active_ &&
- GetBitmapForOptimizedPluginPaint(&bounds, &dib)) {
- copy_rects.push_back(bounds);
- dib_id = dib->id();
- } else if (!is_gpu_rendering_active_) {
+ if (!is_gpu_rendering_active_) {
// Compute a buffer for painting and cache it.
- scoped_ptr<skia::PlatformCanvas> canvas(
- RenderProcess::current()->GetDrawingCanvas(&current_paint_buf_,
- bounds));
+ scoped_ptr<skia::PlatformCanvas> canvas
+ (RenderProcess::current()->GetDrawingCanvas(&current_paint_buf_, bounds));
if (!canvas.get()) {
NOTREACHED();
return;
@@ -548,8 +538,6 @@ void RenderWidget::DoDeferredUpdate() {
for (size_t i = 0; i < copy_rects.size(); ++i)
PaintRect(copy_rects[i], bounds.origin(), canvas.get());
-
- dib_id = current_paint_buf_->id();
} else { // Accelerated compositing path
// Begin painting.
bool finish = next_paint_is_resize_ack();
@@ -558,7 +546,8 @@ void RenderWidget::DoDeferredUpdate() {
// sending an ack to browser process that the paint is complete...
ViewHostMsg_UpdateRect_Params params;
- params.bitmap = dib_id;
+ params.bitmap =
+ current_paint_buf_ ? current_paint_buf_->id() : TransportDIB::Id();
params.bitmap_rect = bounds;
params.dx = update.scroll_delta.x();
params.dy = update.scroll_delta.y();
@@ -900,12 +889,6 @@ void RenderWidget::OnSetTextDirection(WebTextDirection direction) {
webwidget_->setTextDirection(direction);
}
-bool RenderWidget::GetBitmapForOptimizedPluginPaint(gfx::Rect* bounds,
- TransportDIB** dib) {
- // Normal RenderWidgets don't support optimized plugin painting.
- return false;
-}
-
void RenderWidget::SetHidden(bool hidden) {
if (is_hidden_ == hidden)
return;