diff options
author | Mike Reed <reed@google.com> | 2017-10-16 11:42:53 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-10-16 17:33:22 +0000 |
commit | fa15877f487333bec876e7315cf584c0d598d098 (patch) | |
tree | 7ee6ce5183e8cf12505f69d0f1b5bcb7abfccd85 /src/core/SkPixmapPriv.h | |
parent | d28a79d49549568c3ebac36288ea3965496333f8 (diff) |
apply codec origin in generator
Bug: skia:
Change-Id: I383dacb49b1e3c88467ccdbf3288764bb1bbf01a
Reviewed-on: https://skia-review.googlesource.com/58600
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Diffstat (limited to 'src/core/SkPixmapPriv.h')
-rw-r--r-- | src/core/SkPixmapPriv.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/core/SkPixmapPriv.h b/src/core/SkPixmapPriv.h new file mode 100644 index 0000000000..dfc9ce2dd0 --- /dev/null +++ b/src/core/SkPixmapPriv.h @@ -0,0 +1,33 @@ +/* + * Copyright 2015 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +#ifndef SkPixmapPriv_DEFINED +#define SkPixmapPriv_DEFINED + +#include "SkPixmap.h" +#include "SkCodec.h" + +class SkPixmapPriv { +public: + // These flag are applied in this order (swap is applied last) + enum OrientFlags { + kMirrorX = 1 << 0, + kMirrorY = 1 << 1, + kSwapXY = 1 << 2, + }; + + static OrientFlags OriginToOrient(SkCodec::Origin); + + /** + * Copy the pixels in this pixmap into dst, applying the orientation transformations specified + * by the flags. If the inputs are invalid, this returns false and no copy is made. + */ + static bool Orient(const SkPixmap& dst, const SkPixmap& src, OrientFlags); +}; + +#endif + |