diff options
author | mtklein <mtklein@chromium.org> | 2015-07-29 13:14:05 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-07-29 13:14:05 -0700 |
commit | e88b1fb7a5fc25e6c6c194b7191678c0fdba5415 (patch) | |
tree | d7e3ff081de343dcc4392347540abe962fa20a0c /src/core/SkRecords.cpp | |
parent | 3ae4701fe8a55880da4d75510f2eb1b57729196b (diff) |
Move non-trivial constructors out-of-line.
There is more than one way to skin this SkPathPriv.h cat.
These constructors are large enough that they probably shouldn't have
been inlined like this anyway.
BUG=skia:4126
Review URL: https://codereview.chromium.org/1253963004
Diffstat (limited to 'src/core/SkRecords.cpp')
-rw-r--r-- | src/core/SkRecords.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/core/SkRecords.cpp b/src/core/SkRecords.cpp new file mode 100644 index 0000000000..d0a3ddbe10 --- /dev/null +++ b/src/core/SkRecords.cpp @@ -0,0 +1,32 @@ +/* + * Copyright 2015 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +#include "SkPathPriv.h" +#include "SkRecords.h" + +namespace SkRecords { + ImmutableBitmap::ImmutableBitmap(const SkBitmap& bitmap) { + if (bitmap.isImmutable()) { + fBitmap = bitmap; + } else { + bitmap.copyTo(&fBitmap); + } + fBitmap.setImmutable(); + } + + PreCachedPath::PreCachedPath(const SkPath& path) : SkPath(path) { + this->updateBoundsCache(); +#if 0 // Disabled to see if we ever really race on this. It costs time, chromium:496982. + SkPathPriv::FirstDirection junk; + (void)SkPathPriv::CheapComputeFirstDirection(*this, &junk); +#endif + } + + TypedMatrix::TypedMatrix(const SkMatrix& matrix) : SkMatrix(matrix) { + (void)this->getType(); + } +} |