OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/browser/renderer_host/backing_store.h" | 5 #include "chrome/browser/renderer_host/backing_store.h" |
6 | 6 |
7 #include <stdlib.h> | 7 #include <stdlib.h> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 | 149 |
150 XFreePixmap(display_, pixmap); | 150 XFreePixmap(display_, pixmap); |
151 } | 151 } |
152 | 152 |
153 void BackingStore::PaintRect(base::ProcessHandle process, | 153 void BackingStore::PaintRect(base::ProcessHandle process, |
154 TransportDIB* bitmap, | 154 TransportDIB* bitmap, |
155 const gfx::Rect& bitmap_rect) { | 155 const gfx::Rect& bitmap_rect) { |
156 if (!display_) | 156 if (!display_) |
157 return; | 157 return; |
158 | 158 |
| 159 if (bitmap_rect.IsEmpty()) |
| 160 return; |
| 161 |
159 if (!use_render_) | 162 if (!use_render_) |
160 return PaintRectWithoutXrender(bitmap, bitmap_rect); | 163 return PaintRectWithoutXrender(bitmap, bitmap_rect); |
161 | 164 |
162 const int width = bitmap_rect.width(); | 165 const int width = bitmap_rect.width(); |
163 const int height = bitmap_rect.height(); | 166 const int height = bitmap_rect.height(); |
164 Picture picture; | 167 Picture picture; |
165 Pixmap pixmap; | 168 Pixmap pixmap; |
166 | 169 |
167 if (use_shared_memory_) { | 170 if (use_shared_memory_) { |
168 const XID shmseg = bitmap->MapToX(display_); | 171 const XID shmseg = bitmap->MapToX(display_); |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 } | 266 } |
264 | 267 |
265 PaintRect(process, bitmap, bitmap_rect); | 268 PaintRect(process, bitmap, bitmap_rect); |
266 } | 269 } |
267 | 270 |
268 void BackingStore::ShowRect(const gfx::Rect& rect, XID target) { | 271 void BackingStore::ShowRect(const gfx::Rect& rect, XID target) { |
269 XCopyArea(display_, pixmap_, target, static_cast<GC>(pixmap_gc_), | 272 XCopyArea(display_, pixmap_, target, static_cast<GC>(pixmap_gc_), |
270 rect.x(), rect.y(), rect.width(), rect.height(), | 273 rect.x(), rect.y(), rect.width(), rect.height(), |
271 rect.x(), rect.y()); | 274 rect.x(), rect.y()); |
272 } | 275 } |
OLD | NEW |