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

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

Issue 7019013: Removal of dependencies on PlatformDevice classes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Syncing merge conflicts. Created 9 years, 7 months 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
« no previous file with comments | « content/browser/renderer_host/backing_store_win.cc ('k') | content/plugin/webplugin_proxy.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "content/browser/renderer_host/backing_store_x.h" 5 #include "content/browser/renderer_host/backing_store_x.h"
6 6
7 #include <cairo-xlib.h> 7 #include <cairo-xlib.h>
8 #include <gtk/gtk.h> 8 #include <gtk/gtk.h>
9 #include <stdlib.h> 9 #include <stdlib.h>
10 #include <sys/ipc.h> 10 #include <sys/ipc.h>
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 DestroySharedImage(display_, image, &shminfo); 368 DestroySharedImage(display_, image, &shminfo);
369 else 369 else
370 XDestroyImage(image); 370 XDestroyImage(image);
371 return false; 371 return false;
372 } 372 }
373 373
374 // The X image might have a different row stride, so iterate through 374 // The X image might have a different row stride, so iterate through
375 // it and copy each row out, only up to the pixels we're actually 375 // it and copy each row out, only up to the pixels we're actually
376 // using. This code assumes a visual mode where a pixel is 376 // using. This code assumes a visual mode where a pixel is
377 // represented using a 32-bit unsigned int, with a byte per component. 377 // represented using a 32-bit unsigned int, with a byte per component.
378 SkBitmap bitmap = output->getTopPlatformDevice().accessBitmap(true); 378 SkBitmap bitmap = skia::GetTopDevice(*output)->accessBitmap(true);
379 for (int y = 0; y < height; y++) { 379 for (int y = 0; y < height; y++) {
380 const uint32* src_row = reinterpret_cast<uint32*>( 380 const uint32* src_row = reinterpret_cast<uint32*>(
381 &image->data[image->bytes_per_line * y]); 381 &image->data[image->bytes_per_line * y]);
382 uint32* dest_row = bitmap.getAddr32(0, y); 382 uint32* dest_row = bitmap.getAddr32(0, y);
383 for (int x = 0; x < width; ++x, ++dest_row) { 383 for (int x = 0; x < width; ++x, ++dest_row) {
384 // Force alpha to be 0xff, because otherwise it causes rendering problems. 384 // Force alpha to be 0xff, because otherwise it causes rendering problems.
385 *dest_row = src_row[x] | 0xff000000; 385 *dest_row = src_row[x] | 0xff000000;
386 } 386 }
387 } 387 }
388 388
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 cairo_set_source(cr, pattern); 468 cairo_set_source(cr, pattern);
469 cairo_pattern_destroy(pattern); 469 cairo_pattern_destroy(pattern);
470 470
471 cairo_identity_matrix(cr); 471 cairo_identity_matrix(cr);
472 472
473 cairo_rectangle(cr, rect.x(), rect.y(), rect.width(), rect.height()); 473 cairo_rectangle(cr, rect.x(), rect.y(), rect.width(), rect.height());
474 cairo_fill(cr); 474 cairo_fill(cr);
475 cairo_destroy(cr); 475 cairo_destroy(cr);
476 } 476 }
477 #endif 477 #endif
OLDNEW
« no previous file with comments | « content/browser/renderer_host/backing_store_win.cc ('k') | content/plugin/webplugin_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698