diff options
author | Robert Phillips <robertphillips@google.com> | 2018-04-04 11:12:39 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-04-04 15:41:48 +0000 |
commit | c1267c60516cab68e8c7780280256ca8e8e53ab2 (patch) | |
tree | bc6f4c12482ca0c5102cdd6f7d1a79af25956c00 /src/core/SkSurfaceCharacterization.cpp | |
parent | dc09213b17cfd100e1c1859387b47e3045a36010 (diff) |
Add SkSurfaceCharacterization operator== && !=
TBR=bsalomon@google.com
Change-Id: Ic58849dcb3be1f00431f897af328f6f3c3f00d75
Reviewed-on: https://skia-review.googlesource.com/118340
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/core/SkSurfaceCharacterization.cpp')
-rw-r--r-- | src/core/SkSurfaceCharacterization.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/core/SkSurfaceCharacterization.cpp b/src/core/SkSurfaceCharacterization.cpp new file mode 100644 index 0000000000..b82f2a681f --- /dev/null +++ b/src/core/SkSurfaceCharacterization.cpp @@ -0,0 +1,31 @@ +/* + * Copyright 2018 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +#include "SkSurfaceCharacterization.h" + +#if SK_SUPPORT_GPU +bool SkSurfaceCharacterization::operator==(const SkSurfaceCharacterization& other) const { + if (!this->isValid() || !other.isValid()) { + return false; + } + + if (fContextInfo->fContextUniqueID != other.fContextInfo->fContextUniqueID) { + return false; + } + + return fCacheMaxResourceBytes == other.fCacheMaxResourceBytes && + fOrigin == other.fOrigin && + fImageInfo == other.fImageInfo && + fConfig == other.fConfig && + fFSAAType == other.fFSAAType && + fStencilCnt == other.fStencilCnt && + fIsTextureable == other.fIsTextureable && + fIsMipMapped == other.fIsMipMapped && + fSurfaceProps == other.fSurfaceProps; +} + +#endif |