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

Side by Side Diff: ui/display/chromeos/x11/native_display_delegate_x11.cc

Issue 1182063002: Add support for more advanced color correction (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@qcms-fixed-point-gamma
Patch Set: Refactor for glevin@ and load VCGT always Created 5 years, 1 month 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
OLDNEW
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 612 matching lines...) Expand 10 before | Expand all | Expand 10 after
623 return NULL; 623 return NULL;
624 } 624 }
625 625
626 bool NativeDisplayDelegateX11::SetGammaRamp( 626 bool NativeDisplayDelegateX11::SetGammaRamp(
627 const ui::DisplaySnapshot& output, 627 const ui::DisplaySnapshot& output,
628 const std::vector<GammaRampRGBEntry>& lut) { 628 const std::vector<GammaRampRGBEntry>& lut) {
629 NOTIMPLEMENTED(); 629 NOTIMPLEMENTED();
630 return false; 630 return false;
631 } 631 }
632 632
633 bool NativeDisplayDelegateX11::SetColorCorrection(
634 const ui::DisplaySnapshot& output,
635 const std::vector<GammaRampRGBEntry>& degamma_lut,
636 const std::vector<GammaRampRGBEntry>& gamma_lut,
637 const float correction_matrix[9]) {
638 NOTIMPLEMENTED();
639 return false;
640 }
641
633 void NativeDisplayDelegateX11::DrawBackground() { 642 void NativeDisplayDelegateX11::DrawBackground() {
634 if (!background_color_argb_) 643 if (!background_color_argb_)
635 return; 644 return;
636 // Configuring CRTCs/Framebuffer clears the boot screen image. Paint the 645 // Configuring CRTCs/Framebuffer clears the boot screen image. Paint the
637 // same background color after updating framebuffer to minimize the 646 // same background color after updating framebuffer to minimize the
638 // duration of black screen at boot time. 647 // duration of black screen at boot time.
639 XColor color; 648 XColor color;
640 Colormap colormap = DefaultColormap(display_, 0); 649 Colormap colormap = DefaultColormap(display_, 0);
641 // XColor uses 16 bits per color. 650 // XColor uses 16 bits per color.
642 color.red = (background_color_argb_ & 0x00FF0000) >> 8; 651 color.red = (background_color_argb_ & 0x00FF0000) >> 8;
643 color.green = (background_color_argb_ & 0x0000FF00); 652 color.green = (background_color_argb_ & 0x0000FF00);
644 color.blue = (background_color_argb_ & 0x000000FF) << 8; 653 color.blue = (background_color_argb_ & 0x000000FF) << 8;
645 color.flags = DoRed | DoGreen | DoBlue; 654 color.flags = DoRed | DoGreen | DoBlue;
646 XAllocColor(display_, colormap, &color); 655 XAllocColor(display_, colormap, &color);
647 656
648 GC gc = XCreateGC(display_, window_, 0, 0); 657 GC gc = XCreateGC(display_, window_, 0, 0);
649 XSetForeground(display_, gc, color.pixel); 658 XSetForeground(display_, gc, color.pixel);
650 XSetFillStyle(display_, gc, FillSolid); 659 XSetFillStyle(display_, gc, FillSolid);
651 int width = DisplayWidth(display_, DefaultScreen(display_)); 660 int width = DisplayWidth(display_, DefaultScreen(display_));
652 int height = DisplayHeight(display_, DefaultScreen(display_)); 661 int height = DisplayHeight(display_, DefaultScreen(display_));
653 XFillRectangle(display_, window_, gc, 0, 0, width, height); 662 XFillRectangle(display_, window_, gc, 0, 0, width, height);
654 XFreeGC(display_, gc); 663 XFreeGC(display_, gc);
655 XFreeColors(display_, colormap, &color.pixel, 1, 0); 664 XFreeColors(display_, colormap, &color.pixel, 1, 0);
656 } 665 }
657 666
658 } // namespace ui 667 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698