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

Side by Side Diff: chrome/browser/renderer_host/backing_store_x.cc

Issue 506075: Revert 34951 - Combine ViewHostMsg_{Paint,Scroll}Rect into one IPC.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 11 years 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) 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 <sys/ipc.h> 8 #include <sys/ipc.h>
9 #include <sys/shm.h> 9 #include <sys/shm.h>
10 #if defined(TOOLKIT_GTK) 10 #if defined(TOOLKIT_GTK)
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 304
305 // In the case of shared memory, we wait for the composite to complete so that 305 // In the case of shared memory, we wait for the composite to complete so that
306 // we are sure that the X server has finished reading. 306 // we are sure that the X server has finished reading.
307 if (use_shared_memory_) 307 if (use_shared_memory_)
308 XSync(display_, False); 308 XSync(display_, False);
309 309
310 XRenderFreePicture(display_, picture); 310 XRenderFreePicture(display_, picture);
311 XFreePixmap(display_, pixmap); 311 XFreePixmap(display_, pixmap);
312 } 312 }
313 313
314 void BackingStore::ScrollRect(int dx, int dy, 314 void BackingStore::ScrollRect(base::ProcessHandle process,
315 TransportDIB* bitmap,
316 const gfx::Rect& bitmap_rect,
317 int dx, int dy,
315 const gfx::Rect& clip_rect, 318 const gfx::Rect& clip_rect,
316 const gfx::Size& view_size) { 319 const gfx::Size& view_size) {
317 if (!display_) 320 if (!display_)
318 return; 321 return;
319 322
320 // We only support scrolling in one direction at a time. 323 // We only support scrolling in one direction at a time.
321 DCHECK(dx == 0 || dy == 0); 324 DCHECK(dx == 0 || dy == 0);
322 325
323 if (dy) { 326 if (dy) {
324 // Positive values of |dy| scroll up 327 // Positive values of |dy| scroll up
(...skipping 11 matching lines...) Expand all
336 if (abs(dx) < clip_rect.width()) { 339 if (abs(dx) < clip_rect.width()) {
337 XCopyArea(display_, pixmap_, pixmap_, static_cast<GC>(pixmap_gc_), 340 XCopyArea(display_, pixmap_, pixmap_, static_cast<GC>(pixmap_gc_),
338 std::max(clip_rect.x(), clip_rect.x() - dx), 341 std::max(clip_rect.x(), clip_rect.x() - dx),
339 clip_rect.y() /* source y */, 342 clip_rect.y() /* source y */,
340 clip_rect.width() - abs(dx), 343 clip_rect.width() - abs(dx),
341 clip_rect.height(), 344 clip_rect.height(),
342 std::max(clip_rect.x(), clip_rect.x() + dx) /* dest x */, 345 std::max(clip_rect.x(), clip_rect.x() + dx) /* dest x */,
343 clip_rect.y() /* dest x */); 346 clip_rect.y() /* dest x */);
344 } 347 }
345 } 348 }
349
350 PaintRect(process, bitmap, bitmap_rect, bitmap_rect);
346 } 351 }
347 352
348 void BackingStore::ShowRect(const gfx::Rect& rect, XID target) { 353 void BackingStore::ShowRect(const gfx::Rect& rect, XID target) {
349 XCopyArea(display_, pixmap_, target, static_cast<GC>(pixmap_gc_), 354 XCopyArea(display_, pixmap_, target, static_cast<GC>(pixmap_gc_),
350 rect.x(), rect.y(), rect.width(), rect.height(), 355 rect.x(), rect.y(), rect.width(), rect.height(),
351 rect.x(), rect.y()); 356 rect.x(), rect.y());
352 } 357 }
353 358
354 #if defined(TOOLKIT_GTK) 359 #if defined(TOOLKIT_GTK)
355 void BackingStore::PaintToRect(const gfx::Rect& rect, GdkDrawable* target) { 360 void BackingStore::PaintToRect(const gfx::Rect& rect, GdkDrawable* target) {
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 446
442 if (use_shared_memory_) 447 if (use_shared_memory_)
443 DestroySharedImage(display_, image, &shminfo); 448 DestroySharedImage(display_, image, &shminfo);
444 else 449 else
445 XDestroyImage(image); 450 XDestroyImage(image);
446 451
447 HISTOGRAM_TIMES("BackingStore.RetrievalFromX", 452 HISTOGRAM_TIMES("BackingStore.RetrievalFromX",
448 base::TimeTicks::Now() - begin_time); 453 base::TimeTicks::Now() - begin_time);
449 return bitmap; 454 return bitmap;
450 } 455 }
OLDNEW
« no previous file with comments | « chrome/browser/renderer_host/backing_store_win.cc ('k') | chrome/browser/renderer_host/browser_render_process_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698