forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
*re-re-land with SwiftShader fix* *re-land with fix to components_browsertests* This logic allows us to record traces and histograms easily within ANGLE's code. It also gives a flexible design that we can extend with further methods later, without breaking compilation. The design is based on blink::Platform. Also add two new histogram descriptions to histograms.xml, and move the GPU Process metrics init to before InitializeOneOff, so ANGLE can record histograms during Renderer initialization. BUG=436191 TBR=jam@chromium.org, asvitkine@chromium.org, piman@chromium.org, maruel@chromium.org, kbr@chromium.org Review URL: https://codereview.chromium.org/1007513006 Cr-Commit-Position: refs/heads/master@{#321225}
- Loading branch information
Showing
19 changed files
with
193 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,5 +64,6 @@ | |
], | ||
'includes': [ | ||
'../base/base.isolate', | ||
'../third_party/angle/angle.isolate', | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -84,5 +84,6 @@ | |
], | ||
'includes': [ | ||
'../base/base.isolate', | ||
'../third_party/angle/angle.isolate', | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -108,5 +108,6 @@ | |
'includes': [ | ||
'../base/base.isolate', | ||
'../gin/v8.isolate', | ||
'../third_party/angle/angle.isolate', | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -157,5 +157,6 @@ | |
'includes': [ | ||
'../base/base.isolate', | ||
'../gin/v8.isolate', | ||
'../third_party/angle/angle.isolate', | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -94,5 +94,6 @@ | |
], | ||
'includes': [ | ||
'../base/base.isolate', | ||
'../third_party/angle/angle.isolate', | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -141,5 +141,6 @@ | |
'includes': [ | ||
'../base/base.isolate', | ||
'../gin/v8.isolate', | ||
'../third_party/angle/angle.isolate', | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -109,5 +109,6 @@ | |
'includes': [ | ||
'../base/base.isolate', | ||
'../gin/v8.isolate', | ||
'../third_party/angle/angle.isolate', | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -80,5 +80,6 @@ | |
'includes': [ | ||
'../base/base.isolate', | ||
'../gin/v8.isolate', | ||
'../third_party/angle/angle.isolate', | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,5 +59,6 @@ | |
], | ||
'includes': [ | ||
'../base/base.isolate', | ||
'../third_party/angle/angle.isolate', | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// Copyright 2015 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#include "ui/gl/angle_platform_impl.h" | ||
|
||
#include "base/metrics/histogram.h" | ||
#include "base/metrics/sparse_histogram.h" | ||
|
||
namespace gfx { | ||
|
||
ANGLEPlatformImpl::ANGLEPlatformImpl() { | ||
} | ||
|
||
ANGLEPlatformImpl::~ANGLEPlatformImpl() { | ||
} | ||
|
||
void ANGLEPlatformImpl::histogramCustomCounts(const char* name, | ||
int sample, | ||
int min, | ||
int max, | ||
int bucket_count) { | ||
// Copied from histogram macro, but without the static variable caching | ||
// the histogram because name is dynamic. | ||
base::HistogramBase* counter = base::Histogram::FactoryGet( | ||
name, min, max, bucket_count, | ||
base::HistogramBase::kUmaTargetedHistogramFlag); | ||
DCHECK_EQ(name, counter->histogram_name()); | ||
counter->Add(sample); | ||
} | ||
|
||
void ANGLEPlatformImpl::histogramEnumeration(const char* name, | ||
int sample, | ||
int boundary_value) { | ||
// Copied from histogram macro, but without the static variable caching | ||
// the histogram because name is dynamic. | ||
base::HistogramBase* counter = base::LinearHistogram::FactoryGet( | ||
name, 1, boundary_value, boundary_value + 1, | ||
base::HistogramBase::kUmaTargetedHistogramFlag); | ||
DCHECK_EQ(name, counter->histogram_name()); | ||
counter->Add(sample); | ||
} | ||
|
||
void ANGLEPlatformImpl::histogramSparse(const char* name, int sample) { | ||
// For sparse histograms, we can use the macro, as it does not incorporate a | ||
// static. | ||
UMA_HISTOGRAM_SPARSE_SLOWLY(name, sample); | ||
} | ||
|
||
} // namespace gfx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// Copyright 2015 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#ifndef UI_GL_ANGLE_PLATFORM_IMPL_H_ | ||
#define UI_GL_ANGLE_PLATFORM_IMPL_H_ | ||
|
||
// Implements the ANGLE platform interface, for functionality like | ||
// histograms and trace profiling. | ||
|
||
#include "base/macros.h" | ||
#include "third_party/angle/include/platform/Platform.h" | ||
|
||
namespace gfx { | ||
|
||
// Derives the base ANGLE platform and provides implementations | ||
class ANGLEPlatformImpl : public angle::Platform { | ||
public: | ||
ANGLEPlatformImpl(); | ||
~ANGLEPlatformImpl() override; | ||
|
||
// angle::Platform: | ||
void histogramCustomCounts(const char* name, | ||
int sample, | ||
int min, | ||
int max, | ||
int bucket_count) override; | ||
void histogramEnumeration(const char* name, | ||
int sample, | ||
int boundary_value) override; | ||
void histogramSparse(const char* name, int sample) override; | ||
|
||
private: | ||
DISALLOW_COPY_AND_ASSIGN(ANGLEPlatformImpl); | ||
}; | ||
|
||
} // namespace gfx | ||
|
||
#endif // UI_GL_ANGLE_PLATFORM_IMPL_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.