Commit 7057d217 authored by danakj@chromium.org's avatar danakj@chromium.org

gfx: Inline the constructors and destructors for RectBase.

This gives a 5% increase in cc_perftests.

Before:
*RESULT SevenTabSwitcher: frames= 1519.00 runs/s
*RESULT 10_10_layer_tree: frames= 541.09 runs/s

After:
*RESULT SevenTabSwitcher: frames= 1594.62 runs/s
*RESULT 10_10_layer_tree: frames= 569.31 runs/s

BUG=163035
R=jamesr,sky


Review URL: https://chromiumcodereview.appspot.com/11414265

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@170559 0039d316-1c4b-4281-b951-d872f2087c98
parent 8969bb3f
...@@ -145,12 +145,15 @@ class UI_EXPORT RectBase { ...@@ -145,12 +145,15 @@ class UI_EXPORT RectBase {
bool SharesEdgeWith(const Class& rect) const; bool SharesEdgeWith(const Class& rect) const;
protected: protected:
RectBase(const PointClass& origin, const SizeClass& size); RectBase(const PointClass& origin, const SizeClass& size)
explicit RectBase(const SizeClass& size); : origin_(origin), size_(size) {}
explicit RectBase(const PointClass& origin); explicit RectBase(const SizeClass& size)
: size_(size) {}
explicit RectBase(const PointClass& origin)
: origin_(origin) {}
// Destructor is intentionally made non virtual and protected. // Destructor is intentionally made non virtual and protected.
// Do not make this public. // Do not make this public.
~RectBase(); ~RectBase() {}
private: private:
PointClass origin_; PointClass origin_;
......
...@@ -28,48 +28,6 @@ void AdjustAlongAxis(Type dst_origin, Type dst_size, Type* origin, Type* size) { ...@@ -28,48 +28,6 @@ void AdjustAlongAxis(Type dst_origin, Type dst_size, Type* origin, Type* size) {
namespace gfx { namespace gfx {
template<typename Class,
typename PointClass,
typename SizeClass,
typename InsetsClass,
typename VectorClass,
typename Type>
RectBase<Class, PointClass, SizeClass, InsetsClass, VectorClass, Type>::
RectBase(const PointClass& origin, const SizeClass& size)
: origin_(origin), size_(size) {
}
template<typename Class,
typename PointClass,
typename SizeClass,
typename InsetsClass,
typename VectorClass,
typename Type>
RectBase<Class, PointClass, SizeClass, InsetsClass, VectorClass, Type>::
RectBase(const SizeClass& size)
: size_(size) {
}
template<typename Class,
typename PointClass,
typename SizeClass,
typename InsetsClass,
typename VectorClass,
typename Type>
RectBase<Class, PointClass, SizeClass, InsetsClass, VectorClass, Type>::
RectBase(const PointClass& origin)
: origin_(origin) {
}
template<typename Class,
typename PointClass,
typename SizeClass,
typename InsetsClass,
typename VectorClass,
typename Type>
RectBase<Class, PointClass, SizeClass, InsetsClass, VectorClass, Type>::
~RectBase() {}
template<typename Class, template<typename Class,
typename PointClass, typename PointClass,
typename SizeClass, typename SizeClass,
......
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