aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-09-13 12:39:55 +0000
committerGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-09-13 12:39:55 +0000
commitab13167410206c5371508101949213d46e8dded9 (patch)
tree4040d3a73c8b97d561a22b1836a75f0179b6c832
parent5792cded61a7302f32bd0f4aeda51a9b2f1d00f6 (diff)
Removes uses of unnamed namespace from samplecode.
Skia code prefers static over unnamed namespace. R=bsalomon@google.com, robertphillips@google.com Author: tfarina@chromium.org Review URL: https://chromiumcodereview.appspot.com/23498028 git-svn-id: http://skia.googlecode.com/svn/trunk@11248 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r--samplecode/OverView.cpp12
-rw-r--r--samplecode/SampleChart.cpp20
-rw-r--r--samplecode/SampleTextureDomain.cpp6
3 files changed, 14 insertions, 24 deletions
diff --git a/samplecode/OverView.cpp b/samplecode/OverView.cpp
index 3b7183e85a..fec7fb39fb 100644
--- a/samplecode/OverView.cpp
+++ b/samplecode/OverView.cpp
@@ -12,14 +12,10 @@
#include "SkCanvas.h"
#include "SkView.h"
-namespace {
-
-const int N = 8;
-const SkScalar kWidth = SkIntToScalar(640);
-const SkScalar kHeight = SkIntToScalar(480);
-const char gIsOverview[] = "is-overview";
-
-} // namespace
+static const int N = 8;
+static const SkScalar kWidth = SkIntToScalar(640);
+static const SkScalar kHeight = SkIntToScalar(480);
+static const char gIsOverview[] = "is-overview";
class OverView : public SkView {
public:
diff --git a/samplecode/SampleChart.cpp b/samplecode/SampleChart.cpp
index 35f8206f76..630ff6edc3 100644
--- a/samplecode/SampleChart.cpp
+++ b/samplecode/SampleChart.cpp
@@ -1,20 +1,18 @@
-
/*
* Copyright 2013 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
+
#include "SampleCode.h"
#include "SkCanvas.h"
#include "SkPaint.h"
#include "SkRandom.h"
#include "SkView.h"
-namespace {
-
// Generates y values for the chart plots.
-void gen_data(SkScalar yAvg, SkScalar ySpread, int count, SkTDArray<SkScalar>* dataPts) {
+static void gen_data(SkScalar yAvg, SkScalar ySpread, int count, SkTDArray<SkScalar>* dataPts) {
dataPts->setCount(count);
static SkRandom gRandom;
for (int i = 0; i < count; ++i) {
@@ -27,12 +25,12 @@ void gen_data(SkScalar yAvg, SkScalar ySpread, int count, SkTDArray<SkScalar>* d
// plot. The fill path is bounded below by the bottomData plot points or a horizontal line at
// yBase if bottomData == NULL.
// The plots are animated by rotating the data points by leftShift.
-void gen_paths(const SkTDArray<SkScalar>& topData,
- const SkTDArray<SkScalar>* bottomData,
- SkScalar yBase,
- SkScalar xLeft, SkScalar xDelta,
- int leftShift,
- SkPath* plot, SkPath* fill) {
+static void gen_paths(const SkTDArray<SkScalar>& topData,
+ const SkTDArray<SkScalar>* bottomData,
+ SkScalar yBase,
+ SkScalar xLeft, SkScalar xDelta,
+ int leftShift,
+ SkPath* plot, SkPath* fill) {
plot->rewind();
fill->rewind();
plot->incReserve(topData.count());
@@ -80,8 +78,6 @@ void gen_paths(const SkTDArray<SkScalar>& topData,
}
}
-}
-
// A set of scrolling line plots with the area between each plot filled. Stresses out GPU path
// filling
class ChartView : public SampleView {
diff --git a/samplecode/SampleTextureDomain.cpp b/samplecode/SampleTextureDomain.cpp
index 995937ac60..154eaa9fd8 100644
--- a/samplecode/SampleTextureDomain.cpp
+++ b/samplecode/SampleTextureDomain.cpp
@@ -1,18 +1,17 @@
-
/*
* Copyright 2011 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
+
#include "SampleCode.h"
#include "SkBlurMask.h"
#include "SkBlurMaskFilter.h"
#include "SkCanvas.h"
#include "SkDevice.h"
-namespace {
-SkBitmap make_bitmap() {
+static SkBitmap make_bitmap() {
SkBitmap bm;
bm.setConfig(SkBitmap::kARGB_8888_Config , 5, 5);
bm.allocPixels();
@@ -26,7 +25,6 @@ SkBitmap make_bitmap() {
bm.unlockPixels();
return bm;
}
-} // unnamed namespace
class TextureDomainView : public SampleView {
SkBitmap fBM;