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

Side by Side Diff: chromeos/display/real_output_configurator_delegate.h

Issue 24039002: Pepper API implementation for output protection. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: revise output configurator related code. rebased. 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 #ifndef CHROMEOS_DISPLAY_REAL_OUTPUT_CONFIGURATOR_DELEGATE_H_ 5 #ifndef CHROMEOS_DISPLAY_REAL_OUTPUT_CONFIGURATOR_DELEGATE_H_
6 #define CHROMEOS_DISPLAY_REAL_OUTPUT_CONFIGURATOR_DELEGATE_H_ 6 #define CHROMEOS_DISPLAY_REAL_OUTPUT_CONFIGURATOR_DELEGATE_H_
7 7
8 #include <map>
8 #include <vector> 9 #include <vector>
9 10
10 #include "base/basictypes.h" 11 #include "base/basictypes.h"
11 #include "base/compiler_specific.h" 12 #include "base/compiler_specific.h"
12 #include "chromeos/display/output_configurator.h" 13 #include "chromeos/display/output_configurator.h"
13 14
14 typedef XID Window; 15 typedef XID Window;
15 16
16 struct _XDisplay; 17 struct _XDisplay;
17 typedef struct _XDisplay Display; 18 typedef struct _XDisplay Display;
(...skipping 27 matching lines...) Expand all
45 int x, 46 int x,
46 int y) OVERRIDE; 47 int y) OVERRIDE;
47 virtual void CreateFrameBuffer( 48 virtual void CreateFrameBuffer(
48 int width, 49 int width,
49 int height, 50 int height,
50 const std::vector<OutputConfigurator::OutputSnapshot>& outputs) OVERRIDE; 51 const std::vector<OutputConfigurator::OutputSnapshot>& outputs) OVERRIDE;
51 virtual void ConfigureCTM( 52 virtual void ConfigureCTM(
52 int touch_device_id, 53 int touch_device_id,
53 const OutputConfigurator::CoordinateTransformation& ctm) OVERRIDE; 54 const OutputConfigurator::CoordinateTransformation& ctm) OVERRIDE;
54 virtual void SendProjectingStateToPowerManager(bool projecting) OVERRIDE; 55 virtual void SendProjectingStateToPowerManager(bool projecting) OVERRIDE;
56 virtual bool QueryOutputProtectionStatus(
57 chromeos::OutputConfigurator::OutputProtectionClientId client_id,
58 uint32_t* link_mask,
59 uint32_t* protection_mask) OVERRIDE;
60 virtual bool EnableOutputProtection(
61 chromeos::OutputConfigurator::OutputProtectionClientId client_id,
62 uint32_t desired_method_mask) OVERRIDE;
Daniel Erat 2013/09/20 15:00:24 s/method/protection/
kcwu 2013/09/20 20:29:30 Done.
55 63
56 private: 64 private:
65 // Mapping a client to its protection request bitmask.
66 typedef std::map<chromeos::OutputConfigurator::OutputProtectionClientId,
67 uint32_t> ProtectionRequests;
68
69 enum HDCPState {
70 HDCP_STATE_UNDESIRED,
71 HDCP_STATE_DESIRED,
72 HDCP_STATE_ENABLED
73 };
74
57 // Initializes |mode_info| to contain details corresponding to |mode|. Returns 75 // Initializes |mode_info| to contain details corresponding to |mode|. Returns
58 // true on success. 76 // true on success.
59 bool InitModeInfo(RRMode mode, OutputConfigurator::ModeInfo* mode_info); 77 bool InitModeInfo(RRMode mode, OutputConfigurator::ModeInfo* mode_info);
60 78
61 // Helper method for GetOutputs() that returns an OutputSnapshot struct based 79 // Helper method for GetOutputs() that returns an OutputSnapshot struct based
62 // on the passed-in information. Further initialization is required (e.g. 80 // on the passed-in information. Further initialization is required (e.g.
63 // |selected_mode|, |mirror_mode|, and |touch_device_id|). 81 // |selected_mode|, |mirror_mode|, and |touch_device_id|).
64 OutputConfigurator::OutputSnapshot InitOutputSnapshot( 82 OutputConfigurator::OutputSnapshot InitOutputSnapshot(
65 RROutput id, 83 RROutput id,
66 XRROutputInfo* info, 84 XRROutputInfo* info,
(...skipping 10 matching lines...) Expand all
77 bool IsOutputAspectPreservingScaling(RROutput id); 95 bool IsOutputAspectPreservingScaling(RROutput id);
78 96
79 // Searches for touchscreens among input devices, 97 // Searches for touchscreens among input devices,
80 // and tries to match them up to screens in |outputs|. 98 // and tries to match them up to screens in |outputs|.
81 // |outputs| is an array of detected screens. 99 // |outputs| is an array of detected screens.
82 // If a touchscreen with same resolution as an output's native mode 100 // If a touchscreen with same resolution as an output's native mode
83 // is detected, its id will be stored in this output. 101 // is detected, its id will be stored in this output.
84 void GetTouchscreens( 102 void GetTouchscreens(
85 std::vector<OutputConfigurator::OutputSnapshot>* outputs); 103 std::vector<OutputConfigurator::OutputSnapshot>* outputs);
86 104
105 // Get HDCP state of output.
Daniel Erat 2013/09/20 15:00:24 nit: s/Get/Gets/
kcwu 2013/09/20 20:29:30 Done.
106 bool GetHDCPState(RROutput id, HDCPState* state);
107
108 // Set HDCP state of output.
Daniel Erat 2013/09/20 15:00:24 nit: s/Set/Sets/
kcwu 2013/09/20 20:29:30 Done.
109 bool SetHDCPState(RROutput id, HDCPState state);
110
111 // Query output protection link type of output.
Daniel Erat 2013/09/20 15:00:24 nit: s/Query/Queries/
kcwu 2013/09/20 20:29:30 Done.
112 bool QueryOutputProtectionLinkType(
113 RROutput id,
114 OutputType *link_type);
Daniel Erat 2013/09/20 15:00:24 nit: move '*' to left side of space
kcwu 2013/09/20 20:29:30 Done.
115
87 Display* display_; 116 Display* display_;
88 Window window_; 117 Window window_;
89 118
90 // Initialized when the server is grabbed and freed when it's ungrabbed. 119 // Initialized when the server is grabbed and freed when it's ungrabbed.
91 XRRScreenResources* screen_; 120 XRRScreenResources* screen_;
92 121
122 // Output protection requests of each client.
123 ProtectionRequests client_protection_requests_;
124
93 DISALLOW_COPY_AND_ASSIGN(RealOutputConfiguratorDelegate); 125 DISALLOW_COPY_AND_ASSIGN(RealOutputConfiguratorDelegate);
94 }; 126 };
95 127
96 } // namespace chromeos 128 } // namespace chromeos
97 129
98 #endif // CHROMEOS_DISPLAY_REAL_OUTPUT_CONFIGURATOR_DELEGATE_H_ 130 #endif // CHROMEOS_DISPLAY_REAL_OUTPUT_CONFIGURATOR_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698