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

Side by Side Diff: tools/ThermalManager.cpp

Issue 1684653002: enable ThermalManager on Android (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 4 years, 10 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 | « no previous file | tools/nanobench_flags.json » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2016 Google Inc. 2 * Copyright 2016 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "ThermalManager.h" 8 #include "ThermalManager.h"
9 9
10 #include "SkOSFile.h" 10 #include "SkOSFile.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 88
89 ThermalManager::TripPoint::TripPoint(SkString thermalZoneRoot, SkString pointNam e, 89 ThermalManager::TripPoint::TripPoint(SkString thermalZoneRoot, SkString pointNam e,
90 int32_t threshold) 90 int32_t threshold)
91 : fThermalZoneRoot(thermalZoneRoot) 91 : fThermalZoneRoot(thermalZoneRoot)
92 , fPointName(pointName) { 92 , fPointName(pointName) {
93 SkString fullPath(thermalZoneRoot); 93 SkString fullPath(thermalZoneRoot);
94 fullPath.appendf("/%s", pointName.c_str()); 94 fullPath.appendf("/%s", pointName.c_str());
95 fPoint = OpenFileAndReadInt32(fullPath.c_str()); 95 fPoint = OpenFileAndReadInt32(fullPath.c_str());
96 fBase = GetTemp(fThermalZoneRoot); 96 fBase = GetTemp(fThermalZoneRoot);
97 fThreshold = threshold; 97 fThreshold = threshold;
98 fDisabled = fBase >= fPoint + fThreshold; // We disable any trip point whic h start off 98 fDisabled = fBase + fThreshold >= fPoint; // We disable any trip point whic h start off
99 // triggered 99 // triggered
100 if (!fDisabled) { 100 if (!fDisabled) {
101 SkDebugf("Trip point %s base - %d trip point-%d\n", fullPath.c_str(), 101 SkDebugf("Trip point %s base - %d trip point-%d\n", fullPath.c_str(),
102 fBase, fPoint); 102 fBase, fPoint);
103 } 103 }
104 } 104 }
105 105
106 bool ThermalManager::TripPoint::willTrip() { 106 bool ThermalManager::TripPoint::willTrip() {
107 int32_t currentTemp = GetTemp(fThermalZoneRoot); 107 int32_t currentTemp = GetTemp(fThermalZoneRoot);
108 bool wouldTrip = !fDisabled && currentTemp + fThreshold >= fPoint; 108 bool wouldTrip = !fDisabled && currentTemp + fThreshold >= fPoint;
109 109
110 if (wouldTrip) { 110 if (wouldTrip) {
111 SkDebugf("%s/%s would trip {%d,%d,%d,%d}\n", fThermalZoneRoot.c_str(), 111 SkDebugf("%s/%s would trip {%d,%d,%d,%d}\n", fThermalZoneRoot.c_str(),
112 fPointName.c_str(), fBase, currentTemp, fPoint, fThreshold); 112 fPointName.c_str(), fBase, currentTemp, fPoint, fThreshold);
113 } 113 }
114 return wouldTrip; 114 return wouldTrip;
115 } 115 }
116 116
117 #endif 117 #endif
OLDNEW
« no previous file with comments | « no previous file | tools/nanobench_flags.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698