Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(622)

Unified Diff: src/image/SkImage_Codec.cpp

Issue 15806010: Separate core and images project. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Change FORCE_LINKING to be more specific. Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/image/SkImage.cpp ('k') | src/images/SkForceLinking.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/image/SkImage_Codec.cpp
diff --git a/src/image/SkImage_Codec.cpp b/src/image/SkImage_Codec.cpp
index 77ce03779a44b83e753d9c6b06985862407c73e6..61661de3569f86b4faf479ad43fb17219468d29c 100644
--- a/src/image/SkImage_Codec.cpp
+++ b/src/image/SkImage_Codec.cpp
@@ -5,11 +5,11 @@
* found in the LICENSE file.
*/
+#include "SkImageDecoder.h"
#include "SkImage_Base.h"
#include "SkBitmap.h"
#include "SkCanvas.h"
#include "SkData.h"
-#include "../images/SkImageDecoder.h"
class SkImage_Codec : public SkImage_Base {
public:
@@ -64,40 +64,3 @@ SkImage* SkImage::NewEncodedData(SkData* data) {
return SkNEW_ARGS(SkImage_Codec, (data, bitmap.width(), bitmap.height()));
}
-
-///////////////////////////////////////////////////////////////////////////////
-
-// FIXME: Temporarily move this here so chromium can still build until we truly
-// fix the core/images dependency issue (https://code.google.com/p/skia/issues/detail?id=1275)
-#include "SkImage.h"
-#include "../images/SkImageEncoder.h"
-
-static const SkImage_Base* asIB(const SkImage* image) {
- return static_cast<const SkImage_Base*>(image);
-}
-
-static const struct {
- SkImageEncoder::Type fIE;
- SkImage::EncodeType fET;
-} gTable[] = {
- { SkImageEncoder::kBMP_Type, SkImage::kBMP_EncodeType },
- { SkImageEncoder::kGIF_Type, SkImage::kGIF_EncodeType },
- { SkImageEncoder::kICO_Type, SkImage::kICO_EncodeType },
- { SkImageEncoder::kJPEG_Type, SkImage::kJPEG_EncodeType },
- { SkImageEncoder::kPNG_Type, SkImage::kPNG_EncodeType },
- { SkImageEncoder::kWBMP_Type, SkImage::kWBMP_EncodeType },
- { SkImageEncoder::kWEBP_Type, SkImage::kWEBP_EncodeType },
-};
-
-SkData* SkImage::encode(EncodeType et, int quality) const {
- for (size_t i = 0; i < SK_ARRAY_COUNT(gTable); ++i) {
- if (gTable[i].fET == et) {
- SkBitmap bm;
- if (asIB(this)->getROPixels(&bm)) {
- return SkImageEncoder::EncodeData(bm, gTable[i].fIE, quality);
- }
- break;
- }
- }
- return NULL;
-}
« no previous file with comments | « src/image/SkImage.cpp ('k') | src/images/SkForceLinking.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698