summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderat@chromium.org <derat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-02 22:49:24 +0000
committerderat@chromium.org <derat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-02 22:49:24 +0000
commit057af4e66c86b85c9267b63f06591650a84811f7 (patch)
treec46a06f1d44ea8f61843e949905b3cd8cef83c6e
parentd5e03619d4500ea26f04e94196b6d46eb1c319c8 (diff)
downloadchromium_src-057af4e66c86b85c9267b63f06591650a84811f7.zip
chromium_src-057af4e66c86b85c9267b63f06591650a84811f7.tar.gz
chromium_src-057af4e66c86b85c9267b63f06591650a84811f7.tar.bz2
Merge 173851
> 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 TBR=derat@chromium.org Review URL: https://codereview.chromium.org/11744011 git-svn-id: svn://svn.chromium.org/chrome/branches/1364/src@174884 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--ash/wm/boot_splash_screen.cc3
-rw-r--r--ui/aura/root_window_host_linux.cc16
2 files changed, 13 insertions, 6 deletions
diff --git a/ash/wm/boot_splash_screen.cc b/ash/wm/boot_splash_screen.cc
index 2aa1f7c..202ebe2 100644
--- a/ash/wm/boot_splash_screen.cc
+++ b/ash/wm/boot_splash_screen.cc
@@ -30,6 +30,9 @@ class BootSplashScreen::CopyHostContentLayerDelegate
// copy from that canvas to this one here, but this appears to work (i.e. we
// only call this before we draw our first frame) and it saves us an extra
// copy.
+ // TODO(derat): Instead of copying the data, use GLX_EXT_texture_from_pixmap
+ // to create a zero-copy texture (when possible):
+ // https://codereview.chromium.org/10543125
root_window_->CopyAreaToSkCanvas(
gfx::Rect(root_window_->GetHostOrigin(), root_window_->GetHostSize()),
gfx::Point(), canvas->sk_canvas());
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;
}