Removing GrTemplates.h
BUG=skia: Review URL: https://codereview.chromium.org/1233923004
This commit is contained in:
parent
73d5de5763
commit
9ec0d4342d
@ -209,7 +209,6 @@
|
||||
'<(skia_src_path)/gpu/GrSoftwarePathRenderer.h',
|
||||
'<(skia_src_path)/gpu/GrSurfacePriv.h',
|
||||
'<(skia_src_path)/gpu/GrSurface.cpp',
|
||||
'<(skia_src_path)/gpu/GrTemplates.h',
|
||||
'<(skia_src_path)/gpu/GrTextBlobCache.cpp',
|
||||
'<(skia_src_path)/gpu/GrTextBlobCache.h',
|
||||
'<(skia_src_path)/gpu/GrTextContext.cpp',
|
||||
|
@ -20,7 +20,6 @@
|
||||
#include "GrResourceProvider.h"
|
||||
#include "GrRenderTargetPriv.h"
|
||||
#include "GrSurfacePriv.h"
|
||||
#include "GrTemplates.h"
|
||||
#include "GrTexture.h"
|
||||
#include "GrVertexBuffer.h"
|
||||
|
||||
|
@ -6,8 +6,6 @@
|
||||
* found in the LICENSE file.
|
||||
*/
|
||||
|
||||
|
||||
#include "GrTemplates.h"
|
||||
#include "GrFontScaler.h"
|
||||
#include "SkDescriptor.h"
|
||||
#include "SkDistanceFieldGen.h"
|
||||
|
@ -9,7 +9,6 @@
|
||||
|
||||
#include "GrColor.h"
|
||||
#include "GrInOrderDrawBuffer.h"
|
||||
#include "GrTemplates.h"
|
||||
#include "SkPoint.h"
|
||||
|
||||
static bool path_fill_type_is_winding(const GrStencilSettings& pathStencilSettings) {
|
||||
|
@ -12,7 +12,6 @@
|
||||
#include "GrBatchTest.h"
|
||||
#include "GrDefaultGeoProcFactory.h"
|
||||
#include "GrPrimitiveProcessor.h"
|
||||
#include "GrTemplates.h"
|
||||
|
||||
/** We always use per-vertex colors so that rects can be batched across color changes. Sometimes we
|
||||
have explicit local coords and sometimes not. We *could* always provide explicit local coords
|
||||
@ -119,12 +118,12 @@ public:
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
for (int i = 0; i < instanceCount; i++) {
|
||||
const Geometry& geom = fGeoData[i];
|
||||
|
||||
intptr_t offset = GrTCast<intptr_t>(vertices) + kVerticesPerQuad * i * vertexStride;
|
||||
SkPoint* positions = GrTCast<SkPoint*>(offset);
|
||||
intptr_t offset = reinterpret_cast<intptr_t>(vertices) +
|
||||
kVerticesPerQuad * i * vertexStride;
|
||||
SkPoint* positions = reinterpret_cast<SkPoint*>(offset);
|
||||
|
||||
positions->setRectFan(geom.fRect.fLeft, geom.fRect.fTop,
|
||||
geom.fRect.fRight, geom.fRect.fBottom, vertexStride);
|
||||
@ -132,7 +131,7 @@ public:
|
||||
|
||||
if (geom.fHasLocalRect) {
|
||||
static const int kLocalOffset = sizeof(SkPoint) + sizeof(GrColor);
|
||||
SkPoint* coords = GrTCast<SkPoint*>(offset + kLocalOffset);
|
||||
SkPoint* coords = reinterpret_cast<SkPoint*>(offset + kLocalOffset);
|
||||
coords->setRectFan(geom.fLocalRect.fLeft, geom.fLocalRect.fTop,
|
||||
geom.fLocalRect.fRight, geom.fLocalRect.fBottom,
|
||||
vertexStride);
|
||||
@ -142,7 +141,7 @@ public:
|
||||
}
|
||||
|
||||
static const int kColorOffset = sizeof(SkPoint);
|
||||
GrColor* vertColor = GrTCast<GrColor*>(offset + kColorOffset);
|
||||
GrColor* vertColor = reinterpret_cast<GrColor*>(offset + kColorOffset);
|
||||
for (int j = 0; j < 4; ++j) {
|
||||
*vertColor = geom.fColor;
|
||||
vertColor = (GrColor*) ((intptr_t) vertColor + vertexStride);
|
||||
|
@ -1,25 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010 Google Inc.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license that can be
|
||||
* found in the LICENSE file.
|
||||
*/
|
||||
|
||||
#ifndef GrTemplates_DEFINED
|
||||
#define GrTemplates_DEFINED
|
||||
|
||||
#include "SkTypes.h"
|
||||
|
||||
/**
|
||||
* Use to cast a ptr to a different type, and maintain strict-aliasing
|
||||
*/
|
||||
template <typename Dst, typename Src> Dst GrTCast(Src src) {
|
||||
union {
|
||||
Src src;
|
||||
Dst dst;
|
||||
} data;
|
||||
data.src = src;
|
||||
return data.dst;
|
||||
}
|
||||
|
||||
#endif
|
@ -14,7 +14,6 @@
|
||||
#include "GrPipeline.h"
|
||||
#include "GrRenderTargetPriv.h"
|
||||
#include "GrSurfacePriv.h"
|
||||
#include "GrTemplates.h"
|
||||
#include "GrTexturePriv.h"
|
||||
#include "GrTypes.h"
|
||||
#include "GrVertices.h"
|
||||
|
Loading…
Reference in New Issue
Block a user