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

Side by Side Diff: ui/display/types/display_snapshot.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: Rebase after quirks changes Created 4 years, 8 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
« no previous file with comments | « ui/display/types/display_snapshot.h ('k') | ui/display/types/native_display_delegate.h » ('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 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/types/display_snapshot.h" 5 #include "ui/display/types/display_snapshot.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 namespace ui { 9 namespace ui {
10 10
11 namespace { 11 namespace {
12 12
13 // The display serial number beginning byte position and its length in the 13 // The display serial number beginning byte position and its length in the
14 // EDID number as defined in the spec. 14 // EDID number as defined in the spec.
15 // https://en.wikipedia.org/wiki/Extended_Display_Identification_Data 15 // https://en.wikipedia.org/wiki/Extended_Display_Identification_Data
16 const size_t kSerialNumberBeginingByte = 12U; 16 const size_t kSerialNumberBeginingByte = 12U;
17 const size_t kSerialNumberLengthInBytes = 4U; 17 const size_t kSerialNumberLengthInBytes = 4U;
18 18
19 } // namespace 19 } // namespace
20 20
21 DisplaySnapshot::DisplaySnapshot(int64_t display_id, 21 DisplaySnapshot::DisplaySnapshot(int64_t display_id,
22 const gfx::Point& origin, 22 const gfx::Point& origin,
23 const gfx::Size& physical_size, 23 const gfx::Size& physical_size,
24 DisplayConnectionType type, 24 DisplayConnectionType type,
25 bool is_aspect_preserving_scaling, 25 bool is_aspect_preserving_scaling,
26 bool has_overscan, 26 bool has_overscan,
27 bool has_color_correction_matrix,
27 std::string display_name, 28 std::string display_name,
28 const base::FilePath& sys_path, 29 const base::FilePath& sys_path,
29 const std::vector<const DisplayMode*>& modes, 30 const std::vector<const DisplayMode*>& modes,
30 const std::vector<uint8_t>& edid, 31 const std::vector<uint8_t>& edid,
31 const DisplayMode* current_mode, 32 const DisplayMode* current_mode,
32 const DisplayMode* native_mode) 33 const DisplayMode* native_mode)
33 : display_id_(display_id), 34 : display_id_(display_id),
34 origin_(origin), 35 origin_(origin),
35 physical_size_(physical_size), 36 physical_size_(physical_size),
36 type_(type), 37 type_(type),
37 is_aspect_preserving_scaling_(is_aspect_preserving_scaling), 38 is_aspect_preserving_scaling_(is_aspect_preserving_scaling),
38 has_overscan_(has_overscan), 39 has_overscan_(has_overscan),
40 has_color_correction_matrix_(has_color_correction_matrix),
39 display_name_(display_name), 41 display_name_(display_name),
40 sys_path_(sys_path), 42 sys_path_(sys_path),
41 modes_(modes), 43 modes_(modes),
42 edid_(edid), 44 edid_(edid),
43 current_mode_(current_mode), 45 current_mode_(current_mode),
44 native_mode_(native_mode), 46 native_mode_(native_mode),
45 product_id_(kInvalidProductID) { 47 product_id_(kInvalidProductID) {
46 // We must explicitly clear out the bytes that represent the serial number. 48 // We must explicitly clear out the bytes that represent the serial number.
47 const size_t end = 49 const size_t end =
48 std::min(kSerialNumberBeginingByte + kSerialNumberLengthInBytes, 50 std::min(kSerialNumberBeginingByte + kSerialNumberLengthInBytes,
49 edid_.size()); 51 edid_.size());
50 for (size_t i = kSerialNumberBeginingByte; i < end; ++i) 52 for (size_t i = kSerialNumberBeginingByte; i < end; ++i)
51 edid_[i] = 0; 53 edid_[i] = 0;
52 } 54 }
53 55
54 DisplaySnapshot::~DisplaySnapshot() {} 56 DisplaySnapshot::~DisplaySnapshot() {}
55 57
56 } // namespace ui 58 } // namespace ui
OLDNEW
« no previous file with comments | « ui/display/types/display_snapshot.h ('k') | ui/display/types/native_display_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698