Remove unnamed namespace usage from 'gm'.

Skia prefers static over unnamed namespaces.

BUG=None
TEST=None
R=bsalomon@google.com, robertphillips@google.com

Author: tfarina@chromium.org

Review URL: https://codereview.chromium.org/79173002

git-svn-id: http://skia.googlecode.com/svn/trunk@12326 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
commit-bot@chromium.org 2013-11-20 21:32:10 +00:00
parent 0daf00ccd7
commit 6c4e71a5d6
2 changed files with 39 additions and 49 deletions

View File

@ -11,19 +11,15 @@
#include "SkBitmapSource.h"
#include "SkBlurImageFilter.h"
#include "SkColorFilter.h"
#include "SkColorMatrixFilter.h"
#include "SkColorFilterImageFilter.h"
#include "SkColorMatrixFilter.h"
#include "SkFlattenableBuffers.h"
#include "SkMergeImageFilter.h"
#include "SkMorphologyImageFilter.h"
#include "SkOnce.h"
#include "SkTestImageFilters.h"
#include "SkXfermodeImageFilter.h"
#include "SkTestImageFilters.h"
///////////////////////////////////////////////////////////////////////////////
namespace {
// More closely models how Blink's OffsetFilter works as of 10/23/13. SkOffsetImageFilter doesn't
// perform a draw and this one does.
class SimpleOffsetFilter : public SkImageFilter {
@ -76,7 +72,6 @@ protected:
private:
SkScalar fDX, fDY;
};
}
static void init_flattenable(int*) {
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SimpleOffsetFilter)

View File

@ -12,12 +12,10 @@
#define WARN(msg) \
SkDebugf("%s:%d: %s\n", __FILE__, __LINE__, msg);
namespace {
// Do the commands in 'input' match the supplied pattern? Note: this is a pretty
// heavy-weight operation since we are drawing the picture into a debug canvas
// to extract the commands.
bool check_pattern(SkPicture& input, const SkTDArray<DrawType> &pattern) {
static bool check_pattern(SkPicture& input, const SkTDArray<DrawType> &pattern) {
SkDebugCanvas debugCanvas(input.width(), input.height());
debugCanvas.setBounds(input.width(), input.height());
input.draw(&debugCanvas);
@ -47,12 +45,12 @@ bool check_pattern(SkPicture& input, const SkTDArray<DrawType> &pattern) {
// takes a different path if this is false)
// colorsMatch - control if the saveLayer and dbmr2r paint colors
// match (the optimization will fail if they do not)
SkPicture* create_save_layer_opt_1(SkTDArray<DrawType> *preOptPattern,
SkTDArray<DrawType> *postOptPattern,
const SkBitmap& checkerBoard,
bool saveLayerHasPaint,
bool dbmr2rHasPaint,
bool colorsMatch) {
static SkPicture* create_save_layer_opt_1(SkTDArray<DrawType>* preOptPattern,
SkTDArray<DrawType>* postOptPattern,
const SkBitmap& checkerBoard,
bool saveLayerHasPaint,
bool dbmr2rHasPaint,
bool colorsMatch) {
// Create the pattern that should trigger the optimization
preOptPattern->setCount(5);
(*preOptPattern)[0] = SAVE;
@ -120,9 +118,9 @@ SkPicture* create_save_layer_opt_1(SkTDArray<DrawType> *preOptPattern,
}
// straight-ahead version that is seen in the skps
SkPicture* create_save_layer_opt_1_v1(SkTDArray<DrawType> *preOptPattern,
SkTDArray<DrawType> *postOptPattern,
const SkBitmap& checkerBoard) {
static SkPicture* create_save_layer_opt_1_v1(SkTDArray<DrawType>* preOptPattern,
SkTDArray<DrawType>* postOptPattern,
const SkBitmap& checkerBoard) {
return create_save_layer_opt_1(preOptPattern, postOptPattern, checkerBoard,
true, // saveLayer has a paint
true, // dbmr2r has a paint
@ -130,9 +128,9 @@ SkPicture* create_save_layer_opt_1_v1(SkTDArray<DrawType> *preOptPattern,
}
// alternate version that should still succeed
SkPicture* create_save_layer_opt_1_v2(SkTDArray<DrawType> *preOptPattern,
SkTDArray<DrawType> *postOptPattern,
const SkBitmap& checkerBoard) {
static SkPicture* create_save_layer_opt_1_v2(SkTDArray<DrawType>* preOptPattern,
SkTDArray<DrawType>* postOptPattern,
const SkBitmap& checkerBoard) {
return create_save_layer_opt_1(preOptPattern, postOptPattern, checkerBoard,
false, // saveLayer doesn't have a paint!
true, // dbmr2r has a paint
@ -140,9 +138,9 @@ SkPicture* create_save_layer_opt_1_v2(SkTDArray<DrawType> *preOptPattern,
}
// alternate version that should still succeed
SkPicture* create_save_layer_opt_1_v3(SkTDArray<DrawType> *preOptPattern,
SkTDArray<DrawType> *postOptPattern,
const SkBitmap& checkerBoard) {
static SkPicture* create_save_layer_opt_1_v3(SkTDArray<DrawType>* preOptPattern,
SkTDArray<DrawType>* postOptPattern,
const SkBitmap& checkerBoard) {
return create_save_layer_opt_1(preOptPattern, postOptPattern, checkerBoard,
true, // saveLayer has a paint
false, // dbmr2r doesn't have a paint!
@ -150,9 +148,9 @@ SkPicture* create_save_layer_opt_1_v3(SkTDArray<DrawType> *preOptPattern,
}
// version in which the optimization fails b.c. the colors don't match
SkPicture* create_save_layer_opt_1_v4(SkTDArray<DrawType> *preOptPattern,
SkTDArray<DrawType> *postOptPattern,
const SkBitmap& checkerBoard) {
static SkPicture* create_save_layer_opt_1_v4(SkTDArray<DrawType>* preOptPattern,
SkTDArray<DrawType>* postOptPattern,
const SkBitmap& checkerBoard) {
return create_save_layer_opt_1(preOptPattern, postOptPattern, checkerBoard,
true, // saveLayer has a paint
true, // dbmr2r has a paint
@ -174,12 +172,12 @@ SkPicture* create_save_layer_opt_1_v4(SkTDArray<DrawType> *preOptPattern,
// takes a different path if this is false)
// colorsMatch - control if the saveLayer and dbmr2r paint colors
// match (the optimization will fail if they do not)
SkPicture* create_save_layer_opt_2(SkTDArray<DrawType> *preOptPattern,
SkTDArray<DrawType> *postOptPattern,
const SkBitmap& checkerBoard,
bool saveLayerHasPaint,
bool dbmr2rHasPaint,
bool colorsMatch) {
static SkPicture* create_save_layer_opt_2(SkTDArray<DrawType>* preOptPattern,
SkTDArray<DrawType>* postOptPattern,
const SkBitmap& checkerBoard,
bool saveLayerHasPaint,
bool dbmr2rHasPaint,
bool colorsMatch) {
// Create the pattern that should trigger the optimization
preOptPattern->setCount(8);
(*preOptPattern)[0] = SAVE;
@ -260,9 +258,9 @@ SkPicture* create_save_layer_opt_2(SkTDArray<DrawType> *preOptPattern,
}
// straight-ahead version that is seen in the skps
SkPicture* create_save_layer_opt_2_v1(SkTDArray<DrawType> *preOptPattern,
SkTDArray<DrawType> *postOptPattern,
const SkBitmap& checkerBoard) {
static SkPicture* create_save_layer_opt_2_v1(SkTDArray<DrawType>* preOptPattern,
SkTDArray<DrawType>* postOptPattern,
const SkBitmap& checkerBoard) {
return create_save_layer_opt_2(preOptPattern, postOptPattern, checkerBoard,
true, // saveLayer has a paint
true, // dbmr2r has a paint
@ -270,9 +268,9 @@ SkPicture* create_save_layer_opt_2_v1(SkTDArray<DrawType> *preOptPattern,
}
// alternate version that should still succeed
SkPicture* create_save_layer_opt_2_v2(SkTDArray<DrawType> *preOptPattern,
SkTDArray<DrawType> *postOptPattern,
const SkBitmap& checkerBoard) {
static SkPicture* create_save_layer_opt_2_v2(SkTDArray<DrawType>* preOptPattern,
SkTDArray<DrawType>* postOptPattern,
const SkBitmap& checkerBoard) {
return create_save_layer_opt_2(preOptPattern, postOptPattern, checkerBoard,
false, // saveLayer doesn't have a paint!
true, // dbmr2r has a paint
@ -280,9 +278,9 @@ SkPicture* create_save_layer_opt_2_v2(SkTDArray<DrawType> *preOptPattern,
}
// alternate version that should still succeed
SkPicture* create_save_layer_opt_2_v3(SkTDArray<DrawType> *preOptPattern,
SkTDArray<DrawType> *postOptPattern,
const SkBitmap& checkerBoard) {
static SkPicture* create_save_layer_opt_2_v3(SkTDArray<DrawType>* preOptPattern,
SkTDArray<DrawType>* postOptPattern,
const SkBitmap& checkerBoard) {
return create_save_layer_opt_2(preOptPattern, postOptPattern, checkerBoard,
true, // saveLayer has a paint
false, // dbmr2r doesn't have a paint!
@ -290,18 +288,15 @@ SkPicture* create_save_layer_opt_2_v3(SkTDArray<DrawType> *preOptPattern,
}
// version in which the optimization fails b.c. the colors don't match
SkPicture* create_save_layer_opt_2_v4(SkTDArray<DrawType> *preOptPattern,
SkTDArray<DrawType> *postOptPattern,
const SkBitmap& checkerBoard) {
static SkPicture* create_save_layer_opt_2_v4(SkTDArray<DrawType>* preOptPattern,
SkTDArray<DrawType>* postOptPattern,
const SkBitmap& checkerBoard) {
return create_save_layer_opt_2(preOptPattern, postOptPattern, checkerBoard,
true, // saveLayer has a paint
true, // dbmr2r has a paint
false); // and the colors don't match!
}
};
// As our .skp optimizations get folded into the captured skps our code will
// no longer be locally exercised. This GM manually constructs the patterns
// our optimizations will remove to test them. It acts as both a GM and a unit