Commit 139fb7ad authored by dschuff's avatar dschuff Committed by Commit bot

Do not use extern template declarations for RectBase etc for NaCl builds

The GPU command buffer client uses Rect/RectF from gfx.
RectBase and friends have an extern template declaration which means that
instead of inlining the x(), y(), width() and height() methods (e.g. where they
are used in the header and in gles2_implementation.cc), an external
reference is generated instead. Unlike in Chromium, the NaCl IRT build does
not build/link with the gfx/geometry implementation, which means that
these references never get defined.

So do not use the extern template declarations for NaCl.

R=bbudge@chromium.org (GPU untrusted build), danakj@chromium.org (graphics primitives OWNERS)

TEST= NaCl IRT build with no optimization
BUG= https://code.google.com/p/chromium/issues/detail?id=388035

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

Cr-Commit-Position: refs/heads/master@{#291829}
parent bf481022
......@@ -41,7 +41,7 @@ class GFX_EXPORT Insets : public InsetsBase<Insets, int> {
std::string ToString() const;
};
#if !defined(COMPILER_MSVC)
#if !defined(COMPILER_MSVC) && !defined(__native_client__)
extern template class InsetsBase<Insets, int>;
#endif
......
......@@ -24,7 +24,7 @@ class GFX_EXPORT InsetsF : public InsetsBase<InsetsF, float> {
std::string ToString() const;
};
#if !defined(COMPILER_MSVC)
#if !defined(COMPILER_MSVC) && !defined(__native_client__)
extern template class InsetsBase<InsetsF, float>;
#endif
......
......@@ -84,7 +84,7 @@ inline Point PointAtOffsetFromOrigin(const Vector2d& offset_from_origin) {
return Point(offset_from_origin.x(), offset_from_origin.y());
}
#if !defined(COMPILER_MSVC)
#if !defined(COMPILER_MSVC) && !defined(__native_client__)
extern template class PointBase<Point, int, Vector2d>;
#endif
......
......@@ -67,7 +67,7 @@ inline PointF ScalePoint(const PointF& p, float scale) {
return ScalePoint(p, scale, scale);
}
#if !defined(COMPILER_MSVC)
#if !defined(COMPILER_MSVC) && !defined(__native_client__)
extern template class PointBase<PointF, float, Vector2dF>;
#endif
......
......@@ -131,7 +131,7 @@ inline Rect ScaleToEnclosedRect(const Rect& rect, float scale) {
return ScaleToEnclosedRect(rect, scale, scale);
}
#if !defined(COMPILER_MSVC)
#if !defined(COMPILER_MSVC) && !defined(__native_client__)
extern template class RectBase<Rect, Point, Size, Insets, Vector2d, int>;
#endif
......
......@@ -105,7 +105,7 @@ inline RectF ScaleRect(const RectF& r, float scale) {
// contained within the rect, because they will appear on one of these edges.
GFX_EXPORT RectF BoundingRect(const PointF& p1, const PointF& p2);
#if !defined(COMPILER_MSVC)
#if !defined(COMPILER_MSVC) && !defined(__native_client__)
extern template class RectBase<RectF, PointF, SizeF, InsetsF, Vector2dF, float>;
#endif
......
......@@ -59,7 +59,7 @@ inline bool operator!=(const Size& lhs, const Size& rhs) {
return !(lhs == rhs);
}
#if !defined(COMPILER_MSVC)
#if !defined(COMPILER_MSVC) && !defined(__native_client__)
extern template class SizeBase<Size, int>;
#endif
......
......@@ -46,7 +46,7 @@ inline SizeF ScaleSize(const SizeF& p, float scale) {
return ScaleSize(p, scale, scale);
}
#if !defined(COMPILER_MSVC)
#if !defined(COMPILER_MSVC) && !defined(__native_client__)
extern template class SizeBase<SizeF, float>;
#endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment