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

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

Issue 9416017: Optionally clear PlatformCanvas instances. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Address style issues. Created 8 years, 10 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
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_gtk.h" 5 #include "content/browser/renderer_host/backing_store_gtk.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 529 matching lines...) Expand 10 before | Expand all | Expand 10 after
540 } else { 540 } else {
541 // Non-shared memory case just copy the image from the server. 541 // Non-shared memory case just copy the image from the server.
542 image = XGetImage(display_, pixmap_, 542 image = XGetImage(display_, pixmap_,
543 rect.x(), rect.y(), width, height, 543 rect.x(), rect.y(), width, height,
544 AllPlanes, ZPixmap); 544 AllPlanes, ZPixmap);
545 } 545 }
546 546
547 // TODO(jhawkins): Need to convert the image data if the image bits per pixel 547 // TODO(jhawkins): Need to convert the image data if the image bits per pixel
548 // is not 32. 548 // is not 32.
549 // Note that this also initializes the output bitmap as opaque. 549 // Note that this also initializes the output bitmap as opaque.
550 if (!output->initialize(width, height, true) || 550 if (!output->initialize(width, height, skia::PlatformDevice::FLAGS_OPAQUE) ||
551 image->bits_per_pixel != 32) { 551 image->bits_per_pixel != 32) {
552 if (shared_memory_support_ != ui::SHARED_MEMORY_NONE) 552 if (shared_memory_support_ != ui::SHARED_MEMORY_NONE)
553 DestroySharedImage(display_, image, &shminfo); 553 DestroySharedImage(display_, image, &shminfo);
554 else 554 else
555 XDestroyImage(image); 555 XDestroyImage(image);
556 return false; 556 return false;
557 } 557 }
558 558
559 // The X image might have a different row stride, so iterate through 559 // The X image might have a different row stride, so iterate through
560 // it and copy each row out, only up to the pixels we're actually 560 // it and copy each row out, only up to the pixels we're actually
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
653 cairo_set_source(cr, pattern); 653 cairo_set_source(cr, pattern);
654 cairo_pattern_destroy(pattern); 654 cairo_pattern_destroy(pattern);
655 655
656 cairo_identity_matrix(cr); 656 cairo_identity_matrix(cr);
657 657
658 cairo_rectangle(cr, rect.x(), rect.y(), rect.width(), rect.height()); 658 cairo_rectangle(cr, rect.x(), rect.y(), rect.width(), rect.height());
659 cairo_fill(cr); 659 cairo_fill(cr);
660 cairo_destroy(cr); 660 cairo_destroy(cr);
661 } 661 }
662 #endif 662 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698