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

Unified Diff: ui/base/x/x11_util.cc

Issue 854713003: More old files deletion. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Fix tryjobs? Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/base/x/x11_util.h ('k') | ui/events/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/x/x11_util.cc
diff --git a/ui/base/x/x11_util.cc b/ui/base/x/x11_util.cc
index c595e9ddd66a82bc3ae557f93807b00281755b0f..245160167a0351fee17ef8ebd7f5c38c9176f32a 100644
--- a/ui/base/x/x11_util.cc
+++ b/ui/base/x/x11_util.cc
@@ -42,14 +42,11 @@
#include "ui/events/keycodes/keyboard_code_conversion_x.h"
#include "ui/events/x/device_data_manager_x11.h"
#include "ui/events/x/touch_factory_x11.h"
-#include "ui/gfx/canvas.h"
#include "ui/gfx/geometry/insets.h"
#include "ui/gfx/geometry/point.h"
#include "ui/gfx/geometry/point_conversions.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/size.h"
-#include "ui/gfx/image/image_skia.h"
-#include "ui/gfx/image/image_skia_rep.h"
#include "ui/gfx/skia_util.h"
#include "ui/gfx/x/x11_error_tracker.h"
@@ -1193,54 +1190,6 @@ bool GetXWindowStack(Window window, std::vector<XID>* windows) {
return result;
}
-bool CopyAreaToCanvas(XID drawable,
- gfx::Rect source_bounds,
- gfx::Point dest_offset,
- gfx::Canvas* canvas) {
- ui::XScopedImage scoped_image(
- XGetImage(gfx::GetXDisplay(), drawable,
- source_bounds.x(), source_bounds.y(),
- source_bounds.width(), source_bounds.height(),
- AllPlanes, ZPixmap));
- XImage* image = scoped_image.get();
- if (!image) {
- LOG(ERROR) << "XGetImage failed";
- return false;
- }
-
- 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.
- // TODO(derat|marcheu): Remove this if/when ply-image has been updated to
- // set the framebuffer's alpha channel regardless of whether the device
- // claims to support alpha or not.
- for (int i = 0; i < image->width * image->height * 4; i += 4)
- image->data[i + 3] = 0xff;
-
- SkBitmap bitmap;
- bitmap.installPixels(SkImageInfo::MakeN32Premul(image->width,
- image->height),
- image->data, image->bytes_per_line);
- gfx::ImageSkia image_skia;
- gfx::ImageSkiaRep image_rep(bitmap, canvas->image_scale());
- image_skia.AddRepresentation(image_rep);
- canvas->DrawImageInt(image_skia, dest_offset.x(), dest_offset.y());
- } else {
- NOTIMPLEMENTED() << "Unsupported bits-per-pixel " << image->bits_per_pixel;
- return false;
- }
-
- return true;
-}
-
WindowManagerName GuessWindowManager() {
std::string name;
if (GetWindowManagerName(&name)) {
« no previous file with comments | « ui/base/x/x11_util.h ('k') | ui/events/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698