clarify samplecount field in imagegpu
BUG=skia: TBR=bsalomon Review URL: https://codereview.chromium.org/750023002
This commit is contained in:
parent
ec8bb946c3
commit
3f10b9dd2c
@ -45,6 +45,6 @@ extern GrTexture* SkTextureImageGetTexture(SkImage* textureImage);
|
|||||||
// surface needs to perform a copy-on-write
|
// surface needs to perform a copy-on-write
|
||||||
extern void SkTextureImageSetTexture(SkImage* image, GrTexture* texture);
|
extern void SkTextureImageSetTexture(SkImage* image, GrTexture* texture);
|
||||||
|
|
||||||
extern SkImage* SkNewImageFromBitmapTexture(const SkBitmap&, int sampleCount);
|
extern SkImage* SkNewImageFromBitmapTexture(const SkBitmap&, int sampleCountForNewSurfaces);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -17,7 +17,7 @@ class SkImage_Gpu : public SkImage_Base {
|
|||||||
public:
|
public:
|
||||||
SK_DECLARE_INST_COUNT(SkImage_Gpu)
|
SK_DECLARE_INST_COUNT(SkImage_Gpu)
|
||||||
|
|
||||||
SkImage_Gpu(const SkBitmap&, int sampleCount);
|
SkImage_Gpu(const SkBitmap&, int sampleCountForNewSurfaces);
|
||||||
|
|
||||||
void onDraw(SkCanvas*, SkScalar x, SkScalar y, const SkPaint*) const SK_OVERRIDE;
|
void onDraw(SkCanvas*, SkScalar x, SkScalar y, const SkPaint*) const SK_OVERRIDE;
|
||||||
void onDrawRect(SkCanvas*, const SkRect* src, const SkRect& dst,
|
void onDrawRect(SkCanvas*, const SkRect* src, const SkRect& dst,
|
||||||
@ -36,17 +36,17 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
SkBitmap fBitmap;
|
SkBitmap fBitmap;
|
||||||
const int fSampleCount; // 0 if we weren't built from a surface
|
const int fSampleCountForNewSurfaces; // 0 if we don't know
|
||||||
|
|
||||||
typedef SkImage_Base INHERITED;
|
typedef SkImage_Base INHERITED;
|
||||||
};
|
};
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
SkImage_Gpu::SkImage_Gpu(const SkBitmap& bitmap, int sampleCount)
|
SkImage_Gpu::SkImage_Gpu(const SkBitmap& bitmap, int sampleCountForNewSurfaces)
|
||||||
: INHERITED(bitmap.width(), bitmap.height(), NULL)
|
: INHERITED(bitmap.width(), bitmap.height(), NULL)
|
||||||
, fBitmap(bitmap)
|
, fBitmap(bitmap)
|
||||||
, fSampleCount(sampleCount)
|
, fSampleCountForNewSurfaces(sampleCountForNewSurfaces)
|
||||||
{
|
{
|
||||||
SkASSERT(fBitmap.getTexture());
|
SkASSERT(fBitmap.getTexture());
|
||||||
}
|
}
|
||||||
@ -69,7 +69,7 @@ void SkImage_Gpu::onDrawRect(SkCanvas* canvas, const SkRect* src, const SkRect&
|
|||||||
|
|
||||||
SkSurface* SkImage_Gpu::onNewSurface(const SkImageInfo& info, const SkSurfaceProps& props) const {
|
SkSurface* SkImage_Gpu::onNewSurface(const SkImageInfo& info, const SkSurfaceProps& props) const {
|
||||||
GrContext* ctx = this->getTexture()->getContext();
|
GrContext* ctx = this->getTexture()->getContext();
|
||||||
return SkSurface::NewRenderTarget(ctx, info, fSampleCount, &props);
|
return SkSurface::NewRenderTarget(ctx, info, fSampleCountForNewSurfaces, &props);
|
||||||
}
|
}
|
||||||
|
|
||||||
GrTexture* SkImage_Gpu::onGetTexture() const {
|
GrTexture* SkImage_Gpu::onGetTexture() const {
|
||||||
@ -86,11 +86,11 @@ bool SkImage_Gpu::isOpaque() const {
|
|||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
SkImage* SkNewImageFromBitmapTexture(const SkBitmap& bitmap, int sampleCount) {
|
SkImage* SkNewImageFromBitmapTexture(const SkBitmap& bitmap, int sampleCountForNewSurfaces) {
|
||||||
if (NULL == bitmap.getTexture()) {
|
if (NULL == bitmap.getTexture()) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
return SkNEW_ARGS(SkImage_Gpu, (bitmap, sampleCount));
|
return SkNEW_ARGS(SkImage_Gpu, (bitmap, sampleCountForNewSurfaces));
|
||||||
}
|
}
|
||||||
|
|
||||||
SkImage* SkImage::NewTexture(const SkBitmap& bitmap) {
|
SkImage* SkImage::NewTexture(const SkBitmap& bitmap) {
|
||||||
|
Loading…
Reference in New Issue
Block a user