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}
CrOS-Libchrome-Original-Commit: 139fb7ad98ee8af20d557ff78e52473ea36f3ab1
diff --git a/ui/gfx/geometry/insets.h b/ui/gfx/geometry/insets.h
index 00b6125..0137919 100644
--- a/ui/gfx/geometry/insets.h
+++ b/ui/gfx/geometry/insets.h
@@ -41,7 +41,7 @@
std::string ToString() const;
};
-#if !defined(COMPILER_MSVC)
+#if !defined(COMPILER_MSVC) && !defined(__native_client__)
extern template class InsetsBase<Insets, int>;
#endif
diff --git a/ui/gfx/geometry/insets_f.h b/ui/gfx/geometry/insets_f.h
index ac3585a..e325a77 100644
--- a/ui/gfx/geometry/insets_f.h
+++ b/ui/gfx/geometry/insets_f.h
@@ -24,7 +24,7 @@
std::string ToString() const;
};
-#if !defined(COMPILER_MSVC)
+#if !defined(COMPILER_MSVC) && !defined(__native_client__)
extern template class InsetsBase<InsetsF, float>;
#endif
diff --git a/ui/gfx/geometry/point.h b/ui/gfx/geometry/point.h
index aea9dbd..c7ac4ff 100644
--- a/ui/gfx/geometry/point.h
+++ b/ui/gfx/geometry/point.h
@@ -84,7 +84,7 @@
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
diff --git a/ui/gfx/geometry/point_f.h b/ui/gfx/geometry/point_f.h
index 82d00e6..a0b6d33 100644
--- a/ui/gfx/geometry/point_f.h
+++ b/ui/gfx/geometry/point_f.h
@@ -67,7 +67,7 @@
return ScalePoint(p, scale, scale);
}
-#if !defined(COMPILER_MSVC)
+#if !defined(COMPILER_MSVC) && !defined(__native_client__)
extern template class PointBase<PointF, float, Vector2dF>;
#endif
diff --git a/ui/gfx/geometry/rect.h b/ui/gfx/geometry/rect.h
index 83258fd..cf386c5 100644
--- a/ui/gfx/geometry/rect.h
+++ b/ui/gfx/geometry/rect.h
@@ -131,7 +131,7 @@
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
diff --git a/ui/gfx/geometry/rect_f.h b/ui/gfx/geometry/rect_f.h
index 599eae7..fe20965 100644
--- a/ui/gfx/geometry/rect_f.h
+++ b/ui/gfx/geometry/rect_f.h
@@ -105,7 +105,7 @@
// 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
diff --git a/ui/gfx/geometry/size.h b/ui/gfx/geometry/size.h
index 5040a01..10b90a5 100644
--- a/ui/gfx/geometry/size.h
+++ b/ui/gfx/geometry/size.h
@@ -59,7 +59,7 @@
return !(lhs == rhs);
}
-#if !defined(COMPILER_MSVC)
+#if !defined(COMPILER_MSVC) && !defined(__native_client__)
extern template class SizeBase<Size, int>;
#endif
diff --git a/ui/gfx/geometry/size_f.h b/ui/gfx/geometry/size_f.h
index 5763d19..3057d41 100644
--- a/ui/gfx/geometry/size_f.h
+++ b/ui/gfx/geometry/size_f.h
@@ -46,7 +46,7 @@
return ScaleSize(p, scale, scale);
}
-#if !defined(COMPILER_MSVC)
+#if !defined(COMPILER_MSVC) && !defined(__native_client__)
extern template class SizeBase<SizeF, float>;
#endif