| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "base/gfx/point.h" | 7 #include "base/gfx/point.h" |
| 8 #include "base/gfx/size.h" | 8 #include "base/gfx/size.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 SkShader::kRepeat_TileMode); | 329 SkShader::kRepeat_TileMode); |
| 330 paint.setShader(shader)->unref(); | 330 paint.setShader(shader)->unref(); |
| 331 paint.setPorterDuffXfermode(SkPorterDuff::kSrcOver_Mode); | 331 paint.setPorterDuffXfermode(SkPorterDuff::kSrcOver_Mode); |
| 332 canvas->drawPaint(paint); | 332 canvas->drawPaint(paint); |
| 333 } | 333 } |
| 334 | 334 |
| 335 webwidget_->Paint(canvas, rect); | 335 webwidget_->Paint(canvas, rect); |
| 336 | 336 |
| 337 // Flush to underlying bitmap. TODO(darin): is this needed? | 337 // Flush to underlying bitmap. TODO(darin): is this needed? |
| 338 canvas->getTopPlatformDevice().accessBitmap(false); | 338 canvas->getTopPlatformDevice().accessBitmap(false); |
| 339 | |
| 340 // Let the subclass observe this paint operations. | |
| 341 DidPaint(); | |
| 342 } | 339 } |
| 343 | 340 |
| 344 void RenderWidget::DoDeferredPaint() { | 341 void RenderWidget::DoDeferredPaint() { |
| 345 if (!webwidget_ || paint_reply_pending() || paint_rect_.IsEmpty()) | 342 if (!webwidget_ || paint_reply_pending() || paint_rect_.IsEmpty()) |
| 346 return; | 343 return; |
| 347 | 344 |
| 348 // When we are hidden, we want to suppress painting, but we still need to | 345 // When we are hidden, we want to suppress painting, but we still need to |
| 349 // mark this DoDeferredPaint as complete. | 346 // mark this DoDeferredPaint as complete. |
| 350 if (is_hidden_ || size_.IsEmpty()) { | 347 if (is_hidden_ || size_.IsEmpty()) { |
| 351 paint_rect_ = gfx::Rect(); | 348 paint_rect_ = gfx::Rect(); |
| (...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 841 if (i == plugin_window_moves_.size()) | 838 if (i == plugin_window_moves_.size()) |
| 842 plugin_window_moves_.push_back(move); | 839 plugin_window_moves_.push_back(move); |
| 843 } | 840 } |
| 844 | 841 |
| 845 WebScreenInfo RenderWidget::GetScreenInfo(WebWidget* webwidget) { | 842 WebScreenInfo RenderWidget::GetScreenInfo(WebWidget* webwidget) { |
| 846 WebScreenInfo results; | 843 WebScreenInfo results; |
| 847 RenderThread::current()->Send( | 844 RenderThread::current()->Send( |
| 848 new ViewHostMsg_GetScreenInfo(host_window_, &results)); | 845 new ViewHostMsg_GetScreenInfo(host_window_, &results)); |
| 849 return results; | 846 return results; |
| 850 } | 847 } |
| OLD | NEW |