aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview
diff options
context:
space:
mode:
authorelektrahesse2010-10-09 19:05:40 +0200
committerelektrahesse2010-10-09 19:07:11 +0200
commit565d2e1389b0a72e6eca7068988a9312991abfb1 (patch)
tree7103015e3c024cbeb48ff1e7c89dd14bb6ce12ff /linden/indra/newview
parentChanged version to Experimental 2010.10.09 (diff)
downloadmeta-impy-565d2e1389b0a72e6eca7068988a9312991abfb1.zip
meta-impy-565d2e1389b0a72e6eca7068988a9312991abfb1.tar.gz
meta-impy-565d2e1389b0a72e6eca7068988a9312991abfb1.tar.bz2
meta-impy-565d2e1389b0a72e6eca7068988a9312991abfb1.tar.xz
Mac Only: Implemented initial CoreGraphics image decoding to support uploads, both single and bulk, bypassing viewer's internal decoding classes and using osx native frameworks. Also pushing non-fully-working-yet (and thus disabled) code for native j2c decoding.
Diffstat (limited to 'linden/indra/newview')
-rw-r--r--linden/indra/newview/floaterlocalassetbrowse.cpp11
-rw-r--r--linden/indra/newview/llfloaterimagepreview.cpp12
-rw-r--r--linden/indra/newview/llviewerimagelist.cpp11
3 files changed, 30 insertions, 4 deletions
diff --git a/linden/indra/newview/floaterlocalassetbrowse.cpp b/linden/indra/newview/floaterlocalassetbrowse.cpp
index 6564528..443b5bf 100644
--- a/linden/indra/newview/floaterlocalassetbrowse.cpp
+++ b/linden/indra/newview/floaterlocalassetbrowse.cpp
@@ -74,6 +74,9 @@ this feature is still a work in progress.
74#include "llvovolume.h" 74#include "llvovolume.h"
75#include "llface.h" 75#include "llface.h"
76 76
77#ifdef LL_DARWIN
78#include "llwindowmacosx-objc.h"
79#endif
77 80
78/*=======================================*/ 81/*=======================================*/
79/* Instantiating manager class */ 82/* Instantiating manager class */
@@ -227,6 +230,13 @@ void LocalBitmap::updateSelf()
227 230
228bool LocalBitmap::decodeSelf(LLImageRaw* rawimg) 231bool LocalBitmap::decodeSelf(LLImageRaw* rawimg)
229{ 232{
233#ifdef LL_DARWIN
234 if (decodeImageQuartz(filename, rawimg))
235 {
236 rawimg->biasedScaleToPowerOfTwo( LLViewerImage::MAX_IMAGE_SIZE_DEFAULT );
237 return true;
238 }
239#else
230 switch (this->extension) 240 switch (this->extension)
231 { 241 {
232 case IMG_EXTEN_BMP: 242 case IMG_EXTEN_BMP:
@@ -275,6 +285,7 @@ bool LocalBitmap::decodeSelf(LLImageRaw* rawimg)
275 default: 285 default:
276 break; 286 break;
277 } 287 }
288#endif
278 return false; 289 return false;
279} 290}
280 291
diff --git a/linden/indra/newview/llfloaterimagepreview.cpp b/linden/indra/newview/llfloaterimagepreview.cpp
index 9827a31..c81081f 100644
--- a/linden/indra/newview/llfloaterimagepreview.cpp
+++ b/linden/indra/newview/llfloaterimagepreview.cpp
@@ -62,6 +62,10 @@
62 62
63#include "hippoGridManager.h" 63#include "hippoGridManager.h"
64 64
65#ifdef LL_DARWIN
66#include "llwindowmacosx-objc.h"
67#endif
68
65//static 69//static
66S32 LLFloaterImagePreview::sUploadAmount = 10; 70S32 LLFloaterImagePreview::sUploadAmount = 10;
67 71
@@ -353,7 +357,10 @@ bool LLFloaterImagePreview::loadImage(const std::string& src_filename)
353 } 357 }
354 358
355 LLPointer<LLImageRaw> raw_image = new LLImageRaw; 359 LLPointer<LLImageRaw> raw_image = new LLImageRaw;
356 360#ifdef LL_DARWIN
361 if (! decodeImageQuartz(src_filename, raw_image))
362 return false;
363#else
357 switch (codec) 364 switch (codec)
358 { 365 {
359 case IMG_CODEC_BMP: 366 case IMG_CODEC_BMP:
@@ -428,8 +435,9 @@ bool LLFloaterImagePreview::loadImage(const std::string& src_filename)
428 } 435 }
429 436
430 raw_image->biasedScaleToPowerOfTwo(1024); 437 raw_image->biasedScaleToPowerOfTwo(1024);
438#endif
439
431 mRawImagep = raw_image; 440 mRawImagep = raw_image;
432
433 return true; 441 return true;
434} 442}
435 443
diff --git a/linden/indra/newview/llviewerimagelist.cpp b/linden/indra/newview/llviewerimagelist.cpp
index cb02b09..869c9d7 100644
--- a/linden/indra/newview/llviewerimagelist.cpp
+++ b/linden/indra/newview/llviewerimagelist.cpp
@@ -65,6 +65,10 @@
65 65
66#include <sys/stat.h> 66#include <sys/stat.h>
67 67
68#ifdef LL_DARWIN
69#include "llwindowmacosx-objc.h"
70#endif
71
68//////////////////////////////////////////////////////////////////////////// 72////////////////////////////////////////////////////////////////////////////
69 73
70void (*LLViewerImageList::sUUIDCallback)(void **, const LLUUID&) = NULL; 74void (*LLViewerImageList::sUUIDCallback)(void **, const LLUUID&) = NULL;
@@ -920,7 +924,10 @@ BOOL LLViewerImageList::createUploadFile(const std::string& filename,
920{ 924{
921 // First, load the image. 925 // First, load the image.
922 LLPointer<LLImageRaw> raw_image = new LLImageRaw; 926 LLPointer<LLImageRaw> raw_image = new LLImageRaw;
923 927#ifdef LL_DARWIN
928 if (!decodeImageQuartz(filename, raw_image))
929 return FALSE;
930#else
924 switch (codec) 931 switch (codec)
925 { 932 {
926 case IMG_CODEC_BMP: 933 case IMG_CODEC_BMP:
@@ -993,7 +1000,7 @@ BOOL LLViewerImageList::createUploadFile(const std::string& filename,
993 default: 1000 default:
994 return FALSE; 1001 return FALSE;
995 } 1002 }
996 1003#endif
997 LLPointer<LLImageJ2C> compressedImage = convertToUploadFile(raw_image); 1004 LLPointer<LLImageJ2C> compressedImage = convertToUploadFile(raw_image);
998 1005
999 if( !compressedImage->save(out_filename) ) 1006 if( !compressedImage->save(out_filename) )