OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "ui/display/chromeos/x11/native_display_delegate_x11.h" | 5 #include "ui/display/chromeos/x11/native_display_delegate_x11.h" |
6 | 6 |
7 #include <X11/Xatom.h> | 7 #include <X11/Xatom.h> |
8 #include <X11/Xlib.h> | 8 #include <X11/Xlib.h> |
9 #include <X11/extensions/dpms.h> | 9 #include <X11/extensions/dpms.h> |
10 #include <X11/extensions/Xrandr.h> | 10 #include <X11/extensions/Xrandr.h> |
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
601 } | 601 } |
602 | 602 |
603 XRRCrtcGamma* NativeDisplayDelegateX11::CreateGammaRampForProfile( | 603 XRRCrtcGamma* NativeDisplayDelegateX11::CreateGammaRampForProfile( |
604 const DisplaySnapshotX11& x11_output, | 604 const DisplaySnapshotX11& x11_output, |
605 ColorCalibrationProfile new_profile) { | 605 ColorCalibrationProfile new_profile) { |
606 // TODO(mukai|marcheu): Creates the appropriate gamma ramp data from the | 606 // TODO(mukai|marcheu): Creates the appropriate gamma ramp data from the |
607 // profile enum. It would be served by the vendor. | 607 // profile enum. It would be served by the vendor. |
608 return NULL; | 608 return NULL; |
609 } | 609 } |
610 | 610 |
| 611 bool NativeDisplayDelegateX11::SetGammaRamp(const ui::DisplaySnapshot& output, |
| 612 const std::vector<uint16_t>& r, |
| 613 const std::vector<uint16_t>& g, |
| 614 const std::vector<uint16_t>& b) { |
| 615 NOTIMPLEMENTED(); |
| 616 return false; |
| 617 } |
| 618 |
611 void NativeDisplayDelegateX11::DrawBackground() { | 619 void NativeDisplayDelegateX11::DrawBackground() { |
612 if (!background_color_argb_) | 620 if (!background_color_argb_) |
613 return; | 621 return; |
614 // Configuring CRTCs/Framebuffer clears the boot screen image. Paint the | 622 // Configuring CRTCs/Framebuffer clears the boot screen image. Paint the |
615 // same background color after updating framebuffer to minimize the | 623 // same background color after updating framebuffer to minimize the |
616 // duration of black screen at boot time. | 624 // duration of black screen at boot time. |
617 XColor color; | 625 XColor color; |
618 Colormap colormap = DefaultColormap(display_, 0); | 626 Colormap colormap = DefaultColormap(display_, 0); |
619 // XColor uses 16 bits per color. | 627 // XColor uses 16 bits per color. |
620 color.red = (background_color_argb_ & 0x00FF0000) >> 8; | 628 color.red = (background_color_argb_ & 0x00FF0000) >> 8; |
621 color.green = (background_color_argb_ & 0x0000FF00); | 629 color.green = (background_color_argb_ & 0x0000FF00); |
622 color.blue = (background_color_argb_ & 0x000000FF) << 8; | 630 color.blue = (background_color_argb_ & 0x000000FF) << 8; |
623 color.flags = DoRed | DoGreen | DoBlue; | 631 color.flags = DoRed | DoGreen | DoBlue; |
624 XAllocColor(display_, colormap, &color); | 632 XAllocColor(display_, colormap, &color); |
625 | 633 |
626 GC gc = XCreateGC(display_, window_, 0, 0); | 634 GC gc = XCreateGC(display_, window_, 0, 0); |
627 XSetForeground(display_, gc, color.pixel); | 635 XSetForeground(display_, gc, color.pixel); |
628 XSetFillStyle(display_, gc, FillSolid); | 636 XSetFillStyle(display_, gc, FillSolid); |
629 int width = DisplayWidth(display_, DefaultScreen(display_)); | 637 int width = DisplayWidth(display_, DefaultScreen(display_)); |
630 int height = DisplayHeight(display_, DefaultScreen(display_)); | 638 int height = DisplayHeight(display_, DefaultScreen(display_)); |
631 XFillRectangle(display_, window_, gc, 0, 0, width, height); | 639 XFillRectangle(display_, window_, gc, 0, 0, width, height); |
632 XFreeGC(display_, gc); | 640 XFreeGC(display_, gc); |
633 XFreeColors(display_, colormap, &color.pixel, 1, 0); | 641 XFreeColors(display_, colormap, &color.pixel, 1, 0); |
634 } | 642 } |
635 | 643 |
636 } // namespace ui | 644 } // namespace ui |
OLD | NEW |