Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #ifndef SkImage_DEFINED | 8 #ifndef SkImage_DEFINED |
| 9 #define SkImage_DEFINED | 9 #define SkImage_DEFINED |
| 10 | 10 |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 63 AlphaType fAlphaType; | 63 AlphaType fAlphaType; |
| 64 }; | 64 }; |
| 65 | 65 |
| 66 static SkImage* NewRasterCopy(const Info&, const void* pixels, size_t rowByt es); | 66 static SkImage* NewRasterCopy(const Info&, const void* pixels, size_t rowByt es); |
| 67 static SkImage* NewRasterData(const Info&, SkData* pixels, size_t rowBytes); | 67 static SkImage* NewRasterData(const Info&, SkData* pixels, size_t rowBytes); |
| 68 static SkImage* NewEncodedData(SkData*); | 68 static SkImage* NewEncodedData(SkData*); |
| 69 static SkImage* NewTexture(GrTexture*); | 69 static SkImage* NewTexture(GrTexture*); |
| 70 | 70 |
| 71 int width() const { return fWidth; } | 71 int width() const { return fWidth; } |
| 72 int height() const { return fHeight; } | 72 int height() const { return fHeight; } |
| 73 uint32_t uniqueID() const { return fUniqueID; } | 73 uint32_t uniqueID() const { return fUniqueID; } |
|
reed1
2013/04/30 16:17:45
/**
* Return a grtexture if the image is backed b
| |
| 74 GrTexture* getTexture(); | |
| 74 | 75 |
| 75 SkShader* newShaderClamp() const; | 76 SkShader* newShaderClamp() const; |
| 76 SkShader* newShader(SkShader::TileMode, SkShader::TileMode) const; | 77 SkShader* newShader(SkShader::TileMode, SkShader::TileMode) const; |
| 77 | 78 |
| 78 void draw(SkCanvas*, SkScalar x, SkScalar y, const SkPaint*); | 79 void draw(SkCanvas*, SkScalar x, SkScalar y, const SkPaint*); |
| 79 | 80 |
| 80 protected: | 81 protected: |
| 81 SkImage(int width, int height) : | 82 SkImage(int width, int height) : |
| 82 fWidth(width), | 83 fWidth(width), |
| 83 fHeight(height), | 84 fHeight(height), |
| 84 fUniqueID(NextUniqueID()) { | 85 fUniqueID(NextUniqueID()) { |
| 85 | 86 |
| 86 SkASSERT(width >= 0); | 87 SkASSERT(width >= 0); |
| 87 SkASSERT(height >= 0); | 88 SkASSERT(height >= 0); |
| 88 } | 89 } |
| 89 | 90 |
| 90 private: | 91 private: |
| 91 const int fWidth; | 92 const int fWidth; |
| 92 const int fHeight; | 93 const int fHeight; |
| 93 const uint32_t fUniqueID; | 94 const uint32_t fUniqueID; |
| 94 | 95 |
| 95 static uint32_t NextUniqueID(); | 96 static uint32_t NextUniqueID(); |
| 96 | 97 |
| 97 typedef SkRefCnt INHERITED; | 98 typedef SkRefCnt INHERITED; |
| 98 }; | 99 }; |
| 99 | 100 |
| 100 #endif | 101 #endif |
| OLD | NEW |