summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorderat@chromium.org <derat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-19 03:36:07 +0000
committerderat@chromium.org <derat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-19 03:36:07 +0000
commit6bd538c45350980a37429da78a389ca4579dff63 (patch)
tree4dc2f0bd8abfb32a2e646e5aed09990def12758b /ui
parentdb16e6d31233c4c683fdd3d1990c0576f8790317 (diff)
downloadchromium_src-6bd538c45350980a37429da78a389ca4579dff63.zip
chromium_src-6bd538c45350980a37429da78a389ca4579dff63.tar.gz
chromium_src-6bd538c45350980a37429da78a389ca4579dff63.tar.bz2
ash: Fix boot splash screen copy.
This makes RootWindowHostLinux::CopyAreaToSkCanvas() use SkCanvas::drawBitmap() instead of SkCanvas::writePixels() to copy the initial contents of the host window (i.e. the Chrome OS boot screen) to a compositor layer. writePixels() handles component-byte-order conversions but doesn't work in conjunction with SkPicture. BUG=164825 TEST=no black flash when chrome starts when --ash-copy-host-background-at-boot is set (e.g. on mario, alex, or zgb) Review URL: https://chromiumcodereview.appspot.com/11633003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@173851 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r--ui/aura/root_window_host_linux.cc16
1 files changed, 10 insertions, 6 deletions
diff --git a/ui/aura/root_window_host_linux.cc b/ui/aura/root_window_host_linux.cc
index f9529df..c800811 100644
--- a/ui/aura/root_window_host_linux.cc
+++ b/ui/aura/root_window_host_linux.cc
@@ -24,6 +24,7 @@
#include "base/stringprintf.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "third_party/skia/include/core/SkCanvas.h"
+#include "third_party/skia/include/core/SkPostConfig.h"
#include "ui/aura/client/capture_client.h"
#include "ui/aura/client/cursor_client.h"
#include "ui/aura/client/screen_position_client.h"
@@ -714,6 +715,13 @@ bool RootWindowHostLinux::CopyAreaToSkCanvas(const gfx::Rect& source_bounds,
DCHECK(image);
if (image->bits_per_pixel == 32) {
+ if ((0xff << SK_R32_SHIFT) != image->red_mask ||
+ (0xff << SK_G32_SHIFT) != image->green_mask ||
+ (0xff << SK_B32_SHIFT) != image->blue_mask) {
+ LOG(WARNING) << "XImage and Skia byte orders differ";
+ return false;
+ }
+
// Set the alpha channel before copying to the canvas. Otherwise, areas of
// the framebuffer that were cleared by ply-image rather than being obscured
// by an image during boot may end up transparent.
@@ -728,12 +736,8 @@ bool RootWindowHostLinux::CopyAreaToSkCanvas(const gfx::Rect& source_bounds,
image->width, image->height,
image->bytes_per_line);
bitmap.setPixels(image->data);
- SkCanvas::Config8888 config =
- (image->byte_order == LSBFirst) ?
- SkCanvas::kBGRA_Unpremul_Config8888 :
- SkCanvas::kRGBA_Unpremul_Config8888;
- canvas->writePixels(bitmap, dest_offset.x(), dest_offset.y(), config);
- } else if (image->bits_per_pixel == 24) {
+ canvas->drawBitmap(bitmap, SkIntToScalar(0), SkIntToScalar(0), NULL);
+ } else {
NOTIMPLEMENTED() << "Unsupported bits-per-pixel " << image->bits_per_pixel;
return false;
}