move SkMipmapBuilder to private
Change-Id: I77f57b175984a5e373fae951a270a883e7e4c5d3 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/339216 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
This commit is contained in:
parent
5b589fd273
commit
6affa2c2e3
@ -20,6 +20,7 @@
|
||||
#include "include/core/SkString.h"
|
||||
#include "include/private/SkNx.h"
|
||||
#include "src/core/SkMipmap.h"
|
||||
#include "src/core/SkMipmapBuilder.h"
|
||||
#include "tools/ToolUtils.h"
|
||||
|
||||
#include <math.h>
|
||||
|
@ -42,30 +42,6 @@ class GrYUVABackendTextures;
|
||||
|
||||
struct SkYUVAIndex;
|
||||
|
||||
class SkMipmapBuilder {
|
||||
public:
|
||||
SkMipmapBuilder(const SkImageInfo&);
|
||||
~SkMipmapBuilder();
|
||||
|
||||
int countLevels() const;
|
||||
SkPixmap level(int index) const;
|
||||
|
||||
/**
|
||||
* If these levels are compatible with src, return a new Image that combines src's base level
|
||||
* with these levels as mip levels. If not compatible, this returns nullptr.
|
||||
*/
|
||||
sk_sp<SkImage> attachTo(const SkImage* src);
|
||||
|
||||
sk_sp<SkImage> attachTo(sk_sp<SkImage> src) {
|
||||
return this->attachTo(src.get());
|
||||
}
|
||||
|
||||
private:
|
||||
sk_sp<SkMipmap> fMM;
|
||||
|
||||
friend class SkImage;
|
||||
};
|
||||
|
||||
/** \class SkImage
|
||||
SkImage describes a two dimensional array of pixels to draw. The pixels may be
|
||||
decoded in a raster bitmap, encoded in a SkPicture or compressed data stream,
|
||||
|
@ -15,6 +15,7 @@
|
||||
#include "include/private/SkVx.h"
|
||||
#include "src/core/SkMathPriv.h"
|
||||
#include "src/core/SkMipmap.h"
|
||||
#include "src/core/SkMipmapBuilder.h"
|
||||
#include <new>
|
||||
|
||||
//
|
||||
|
37
src/core/SkMipmapBuilder.h
Normal file
37
src/core/SkMipmapBuilder.h
Normal file
@ -0,0 +1,37 @@
|
||||
/*
|
||||
* Copyright 2020 Google Inc.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license that can be
|
||||
* found in the LICENSE file.
|
||||
*/
|
||||
|
||||
#ifndef SkMipmapBuilder_DEFINED
|
||||
#define SkMipmapBuilder_DEFINED
|
||||
|
||||
#include "include/core/SkImage.h"
|
||||
|
||||
class SkMipmapBuilder {
|
||||
public:
|
||||
SkMipmapBuilder(const SkImageInfo&);
|
||||
~SkMipmapBuilder();
|
||||
|
||||
int countLevels() const;
|
||||
SkPixmap level(int index) const;
|
||||
|
||||
/**
|
||||
* If these levels are compatible with src, return a new Image that combines src's base level
|
||||
* with these levels as mip levels. If not compatible, this returns nullptr.
|
||||
*/
|
||||
sk_sp<SkImage> attachTo(const SkImage* src);
|
||||
|
||||
sk_sp<SkImage> attachTo(sk_sp<SkImage> src) {
|
||||
return this->attachTo(src.get());
|
||||
}
|
||||
|
||||
private:
|
||||
sk_sp<SkMipmap> fMM;
|
||||
|
||||
friend class SkImage;
|
||||
};
|
||||
|
||||
#endif
|
@ -14,6 +14,7 @@
|
||||
#include "src/core/SkAutoMalloc.h"
|
||||
#include "src/core/SkMathPriv.h"
|
||||
#include "src/core/SkMatrixPriv.h"
|
||||
#include "src/core/SkMipmapBuilder.h"
|
||||
#include "src/core/SkReadBuffer.h"
|
||||
#include "src/core/SkSafeMath.h"
|
||||
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include "src/core/SkImageFilter_Base.h"
|
||||
#include "src/core/SkImagePriv.h"
|
||||
#include "src/core/SkMipmap.h"
|
||||
#include "src/core/SkMipmapBuilder.h"
|
||||
#include "src/core/SkNextID.h"
|
||||
#include "src/core/SkSpecialImage.h"
|
||||
#include "src/image/SkImage_Base.h"
|
||||
|
@ -213,6 +213,7 @@ DEF_TEST(MipMap_F16, reporter) {
|
||||
|
||||
#include "include/core/SkCanvas.h"
|
||||
#include "include/core/SkSurface.h"
|
||||
#include "src/core/SkMipmapBuilder.h"
|
||||
|
||||
static void fill_in_mips(SkMipmapBuilder* builder, sk_sp<SkImage> img) {
|
||||
int count = builder->countLevels();
|
||||
|
Loading…
Reference in New Issue
Block a user