Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Alchemy Viewer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Silent mode is enabled
All outbound communications are blocked.
Learn more
.
Show more breadcrumbs
Alchemy Viewer
Alchemy Viewer
Commits
e3f5b66d
Commit
e3f5b66d
authored
14 years ago
by
Xiaohong Bao
Browse files
Options
Downloads
Patches
Plain Diff
fix for SH-829: Viewer attempting to load precached images in file types that are not being used.
parent
47e31543
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
indra/llimage/llimage.cpp
+9
-9
9 additions, 9 deletions
indra/llimage/llimage.cpp
indra/llimage/llimage.h
+2
-2
2 additions, 2 deletions
indra/llimage/llimage.h
indra/newview/lltexturecache.cpp
+6
-0
6 additions, 0 deletions
indra/newview/lltexturecache.cpp
with
17 additions
and
11 deletions
indra/llimage/llimage.cpp
+
9
−
9
View file @
e3f5b66d
...
@@ -276,11 +276,11 @@ LLImageRaw::LLImageRaw(U8 *data, U16 width, U16 height, S8 components)
...
@@ -276,11 +276,11 @@ LLImageRaw::LLImageRaw(U8 *data, U16 width, U16 height, S8 components)
++
sRawImageCount
;
++
sRawImageCount
;
}
}
LLImageRaw
::
LLImageRaw
(
const
std
::
string
&
filename
,
bool
j2c_lowest_mip_only
)
//
LLImageRaw::LLImageRaw(const std::string& filename, bool j2c_lowest_mip_only)
:
LLImageBase
()
//
: LLImageBase()
{
//
{
createFromFile
(
filename
,
j2c_lowest_mip_only
);
//
createFromFile(filename, j2c_lowest_mip_only);
}
//
}
LLImageRaw
::~
LLImageRaw
()
LLImageRaw
::~
LLImageRaw
()
{
{
...
@@ -1180,7 +1180,7 @@ file_extensions[] =
...
@@ -1180,7 +1180,7 @@ file_extensions[] =
{
"png"
,
IMG_CODEC_PNG
}
{
"png"
,
IMG_CODEC_PNG
}
};
};
#define NUM_FILE_EXTENSIONS LL_ARRAY_SIZE(file_extensions)
#define NUM_FILE_EXTENSIONS LL_ARRAY_SIZE(file_extensions)
#if 0
static std::string find_file(std::string &name, S8 *codec)
static std::string find_file(std::string &name, S8 *codec)
{
{
std::string tname;
std::string tname;
...
@@ -1198,7 +1198,7 @@ static std::string find_file(std::string &name, S8 *codec)
...
@@ -1198,7 +1198,7 @@ static std::string find_file(std::string &name, S8 *codec)
}
}
return std::string("");
return std::string("");
}
}
#endif
EImageCodec
LLImageBase
::
getCodecFromExtension
(
const
std
::
string
&
exten
)
EImageCodec
LLImageBase
::
getCodecFromExtension
(
const
std
::
string
&
exten
)
{
{
for
(
int
i
=
0
;
i
<
(
int
)(
NUM_FILE_EXTENSIONS
);
i
++
)
for
(
int
i
=
0
;
i
<
(
int
)(
NUM_FILE_EXTENSIONS
);
i
++
)
...
@@ -1208,7 +1208,7 @@ EImageCodec LLImageBase::getCodecFromExtension(const std::string& exten)
...
@@ -1208,7 +1208,7 @@ EImageCodec LLImageBase::getCodecFromExtension(const std::string& exten)
}
}
return
IMG_CODEC_INVALID
;
return
IMG_CODEC_INVALID
;
}
}
#if 0
bool LLImageRaw::createFromFile(const std::string &filename, bool j2c_lowest_mip_only)
bool LLImageRaw::createFromFile(const std::string &filename, bool j2c_lowest_mip_only)
{
{
std::string name = filename;
std::string name = filename;
...
@@ -1315,7 +1315,7 @@ bool LLImageRaw::createFromFile(const std::string &filename, bool j2c_lowest_mip
...
@@ -1315,7 +1315,7 @@ bool LLImageRaw::createFromFile(const std::string &filename, bool j2c_lowest_mip
return true;
return true;
}
}
#endif
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
// LLImageFormatted
// LLImageFormatted
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
...
...
This diff is collapsed.
Click to expand it.
indra/llimage/llimage.h
+
2
−
2
View file @
e3f5b66d
...
@@ -164,7 +164,7 @@ class LLImageRaw : public LLImageBase
...
@@ -164,7 +164,7 @@ class LLImageRaw : public LLImageBase
LLImageRaw
(
U16
width
,
U16
height
,
S8
components
);
LLImageRaw
(
U16
width
,
U16
height
,
S8
components
);
LLImageRaw
(
U8
*
data
,
U16
width
,
U16
height
,
S8
components
);
LLImageRaw
(
U8
*
data
,
U16
width
,
U16
height
,
S8
components
);
// Construct using createFromFile (used by tools)
// Construct using createFromFile (used by tools)
LLImageRaw
(
const
std
::
string
&
filename
,
bool
j2c_lowest_mip_only
=
false
);
//
LLImageRaw(const std::string& filename, bool j2c_lowest_mip_only = false);
/*virtual*/
void
deleteData
();
/*virtual*/
void
deleteData
();
/*virtual*/
U8
*
allocateData
(
S32
size
=
-
1
);
/*virtual*/
U8
*
allocateData
(
S32
size
=
-
1
);
...
@@ -226,7 +226,7 @@ class LLImageRaw : public LLImageBase
...
@@ -226,7 +226,7 @@ class LLImageRaw : public LLImageBase
protected:
protected:
// Create an image from a local file (generally used in tools)
// Create an image from a local file (generally used in tools)
bool
createFromFile
(
const
std
::
string
&
filename
,
bool
j2c_lowest_mip_only
=
false
);
//
bool createFromFile(const std::string& filename, bool j2c_lowest_mip_only = false);
void
copyLineScaled
(
U8
*
in
,
U8
*
out
,
S32
in_pixel_len
,
S32
out_pixel_len
,
S32
in_pixel_step
,
S32
out_pixel_step
);
void
copyLineScaled
(
U8
*
in
,
U8
*
out
,
S32
in_pixel_len
,
S32
out_pixel_len
,
S32
in_pixel_step
,
S32
out_pixel_step
);
void
compositeRowScaled4onto3
(
U8
*
in
,
U8
*
out
,
S32
in_pixel_len
,
S32
out_pixel_len
);
void
compositeRowScaled4onto3
(
U8
*
in
,
U8
*
out
,
S32
in_pixel_len
,
S32
out_pixel_len
);
...
...
This diff is collapsed.
Click to expand it.
indra/newview/lltexturecache.cpp
+
6
−
0
View file @
e3f5b66d
...
@@ -326,6 +326,7 @@ bool LLTextureCacheRemoteWorker::doRead()
...
@@ -326,6 +326,7 @@ bool LLTextureCacheRemoteWorker::doRead()
// First state / stage : find out if the file is local
// First state / stage : find out if the file is local
if
(
mState
==
INIT
)
if
(
mState
==
INIT
)
{
{
#if 0
std::string filename = mCache->getLocalFileName(mID);
std::string filename = mCache->getLocalFileName(mID);
// Is it a JPEG2000 file?
// Is it a JPEG2000 file?
{
{
...
@@ -360,6 +361,11 @@ bool LLTextureCacheRemoteWorker::doRead()
...
@@ -360,6 +361,11 @@ bool LLTextureCacheRemoteWorker::doRead()
}
}
// Determine the next stage: if we found a file, then LOCAL else CACHE
// Determine the next stage: if we found a file, then LOCAL else CACHE
mState = (local_size > 0 ? LOCAL : CACHE);
mState = (local_size > 0 ? LOCAL : CACHE);
llassert_always(mState == CACHE) ;
#else
mState
=
CACHE
;
#endif
}
}
// Second state / stage : if the file is local, load it and leave
// Second state / stage : if the file is local, load it and leave
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment