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

Unified Diff: ui/gl/angle_platform_impl.cc

Issue 1001833005: Update from https://crrev.com/320343 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Supress Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/gl/angle_platform_impl.h ('k') | ui/gl/gl.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/angle_platform_impl.cc
diff --git a/ui/gl/angle_platform_impl.cc b/ui/gl/angle_platform_impl.cc
new file mode 100644
index 0000000000000000000000000000000000000000..2ce12b823afb36bb1a3f3cb46f7e3e4c7699822f
--- /dev/null
+++ b/ui/gl/angle_platform_impl.cc
@@ -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
« no previous file with comments | « ui/gl/angle_platform_impl.h ('k') | ui/gl/gl.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698