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

Side by Side Diff: trunk/src/ui/base/x/x11_util.cc

Issue 24262008: Revert 224473 "Remove dependency on ui::ScaleFactor from ui/gfx" (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 3 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 | « trunk/src/ui/base/resource/resource_bundle_win.cc ('k') | trunk/src/ui/compositor/layer.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // This file defines utility functions for X11 (Linux only). This code has been 5 // This file defines utility functions for X11 (Linux only). This code has been
6 // ported from XCB since we can't use XCB on Ubuntu while its 32-bit support 6 // ported from XCB since we can't use XCB on Ubuntu while its 32-bit support
7 // remains woefully incomplete. 7 // remains woefully incomplete.
8 8
9 #include "ui/base/x/x11_util.h" 9 #include "ui/base/x/x11_util.h"
10 10
(...skipping 1208 matching lines...) Expand 10 before | Expand all | Expand 10 after
1219 // claims to support alpha or not. 1219 // claims to support alpha or not.
1220 for (int i = 0; i < image->width * image->height * 4; i += 4) 1220 for (int i = 0; i < image->width * image->height * 4; i += 4)
1221 image->data[i + 3] = 0xff; 1221 image->data[i + 3] = 0xff;
1222 1222
1223 SkBitmap bitmap; 1223 SkBitmap bitmap;
1224 bitmap.setConfig(SkBitmap::kARGB_8888_Config, 1224 bitmap.setConfig(SkBitmap::kARGB_8888_Config,
1225 image->width, image->height, 1225 image->width, image->height,
1226 image->bytes_per_line); 1226 image->bytes_per_line);
1227 bitmap.setPixels(image->data); 1227 bitmap.setPixels(image->data);
1228 gfx::ImageSkia image_skia; 1228 gfx::ImageSkia image_skia;
1229 gfx::ImageSkiaRep image_rep(bitmap, canvas->image_scale()); 1229 gfx::ImageSkiaRep image_rep(bitmap, canvas->scale_factor());
1230 image_skia.AddRepresentation(image_rep); 1230 image_skia.AddRepresentation(image_rep);
1231 canvas->DrawImageInt(image_skia, dest_offset.x(), dest_offset.y()); 1231 canvas->DrawImageInt(image_skia, dest_offset.x(), dest_offset.y());
1232 } else { 1232 } else {
1233 NOTIMPLEMENTED() << "Unsupported bits-per-pixel " << image->bits_per_pixel; 1233 NOTIMPLEMENTED() << "Unsupported bits-per-pixel " << image->bits_per_pixel;
1234 return false; 1234 return false;
1235 } 1235 }
1236 1236
1237 return true; 1237 return true;
1238 } 1238 }
1239 1239
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after
1724 << "request_code " << static_cast<int>(error_event.request_code) << ", " 1724 << "request_code " << static_cast<int>(error_event.request_code) << ", "
1725 << "minor_code " << static_cast<int>(error_event.minor_code) 1725 << "minor_code " << static_cast<int>(error_event.minor_code)
1726 << " (" << request_str << ")"; 1726 << " (" << request_str << ")";
1727 } 1727 }
1728 1728
1729 // ---------------------------------------------------------------------------- 1729 // ----------------------------------------------------------------------------
1730 // End of x11_util_internal.h 1730 // End of x11_util_internal.h
1731 1731
1732 1732
1733 } // namespace ui 1733 } // namespace ui
OLDNEW
« no previous file with comments | « trunk/src/ui/base/resource/resource_bundle_win.cc ('k') | trunk/src/ui/compositor/layer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698