Bug 1102048 (Part 05, Decoder) - Make image/src files comply with the Mozilla Coding Style Guide. r=seth

This commit is contained in:
Glenn Randers-Pehrson 2015-02-10 16:47:00 -08:00
parent 3d9503e192
commit 0ac0624fb1
2 changed files with 24 additions and 16 deletions

View File

@ -210,8 +210,9 @@ Decoder::Write(const char* aBuffer, uint32_t aCount)
}
// If a data error occured, just ignore future data.
if (HasDataError())
if (HasDataError()) {
return;
}
if (IsSizeDecode() && HasSize()) {
// More data came in since we found the size. We have nothing to do here.
@ -248,12 +249,14 @@ void
Decoder::CompleteDecode()
{
// Implementation-specific finalization
if (!HasError())
if (!HasError()) {
FinishInternal();
}
// If the implementation left us mid-frame, finish that up.
if (mInFrame && !HasError())
if (mInFrame && !HasError()) {
PostFrameStop();
}
// If PostDecodeDone() has not been called, and this decoder wasn't aborted
// early because of low-memory conditions or losing a race with another
@ -603,9 +606,10 @@ Decoder::PostFrameStart()
}
void
Decoder::PostFrameStop(Opacity aFrameOpacity /* = Opacity::TRANSPARENT */,
DisposalMethod aDisposalMethod /* = DisposalMethod::KEEP */,
int32_t aTimeout /* = 0 */,
Decoder::PostFrameStop(Opacity aFrameOpacity /* = Opacity::TRANSPARENT */,
DisposalMethod aDisposalMethod
/* = DisposalMethod::KEEP */,
int32_t aTimeout /* = 0 */,
BlendMethod aBlendMethod /* = BlendMethod::OVER */)
{
// We should be mid-frame

View File

@ -3,8 +3,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef MOZILLA_IMAGELIB_DECODER_H_
#define MOZILLA_IMAGELIB_DECODER_H_
#ifndef mozilla_image_src_Decoder_h
#define mozilla_image_src_Decoder_h
#include "FrameAnimator.h"
#include "RasterImage.h"
@ -217,8 +217,11 @@ public:
// is only 0 if we haven't begun any frames.
uint32_t GetFrameCount() { return mFrameCount; }
// The number of complete frames we have (ie, not including anything in-progress).
uint32_t GetCompleteFrameCount() { return mInFrame ? mFrameCount - 1 : mFrameCount; }
// The number of complete frames we have (ie, not including anything
// in-progress).
uint32_t GetCompleteFrameCount() {
return mInFrame ? mFrameCount - 1 : mFrameCount;
}
// Error tracking
bool HasError() const { return HasDataError() || HasDecoderError(); }
@ -244,8 +247,9 @@ public:
bool WasAborted() const { return mDecodeAborted; }
enum DecodeStyle {
PROGRESSIVE, // produce intermediate frames representing the partial state of the image
SEQUENTIAL // decode to final image immediately
PROGRESSIVE, // produce intermediate frames representing the partial
// state of the image
SEQUENTIAL // decode to final image immediately
};
void SetFlags(uint32_t aFlags) { mFlags = aFlags; }
@ -286,8 +290,8 @@ public:
uint32_t width, uint32_t height,
gfx::SurfaceFormat format,
uint8_t palette_depth = 0);
virtual bool NeedsNewFrame() const { return mNeedsNewFrame; }
virtual bool NeedsNewFrame() const { return mNeedsNewFrame; }
// Try to allocate a frame as described in mNewFrameData and return the
// status code from that attempt. Clears mNewFrameData.
@ -443,9 +447,9 @@ protected:
nsIntRect mInvalidRect; // Tracks an invalidation region in the current frame.
Progress mProgress;
uint8_t* mImageData; // Pointer to image data in either Cairo or 8bit format
uint8_t* mImageData; // Pointer to image data in either Cairo or 8bit format
uint32_t mImageDataLength;
uint32_t* mColormap; // Current colormap to be used in Cairo format
uint32_t* mColormap; // Current colormap to be used in Cairo format
uint32_t mColormapSize;
// Telemetry data for this decoder.
@ -498,4 +502,4 @@ private:
} // namespace image
} // namespace mozilla
#endif // MOZILLA_IMAGELIB_DECODER_H_
#endif // mozilla_image_src_Decoder_h