gecko-dev/gfx/thebes/gfxPattern.h

76 строки
2.7 KiB
C
Исходник Обычный вид История

2005-04-06 05:54:26 +04:00
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2012-05-21 15:12:37 +04:00
* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
2005-04-06 05:54:26 +04:00
#ifndef GFX_PATTERN_H
#define GFX_PATTERN_H
2005-04-06 05:54:26 +04:00
#include "gfxTypes.h"
2005-04-06 05:54:26 +04:00
#include "gfxMatrix.h"
#include "mozilla/Alignment.h"
#include "mozilla/gfx/2D.h"
#include "mozilla/gfx/PatternHelpers.h"
#include "nsISupportsImpl.h"
#include "nsTArray.h"
2005-04-06 05:54:26 +04:00
typedef struct _cairo_pattern cairo_pattern_t;
class gfxPattern final{
NS_INLINE_DECL_REFCOUNTING(gfxPattern)
2005-04-06 05:54:26 +04:00
public:
explicit gfxPattern(const mozilla::gfx::Color& aColor);
2005-04-06 05:54:26 +04:00
// linear
gfxPattern(gfxFloat x0, gfxFloat y0, gfxFloat x1, gfxFloat y1); // linear
gfxPattern(gfxFloat cx0, gfxFloat cy0, gfxFloat radius0,
gfxFloat cx1, gfxFloat cy1, gfxFloat radius1); // radial
gfxPattern(mozilla::gfx::SourceSurface *aSurface,
const mozilla::gfx::Matrix &aPatternToUserSpace);
2005-04-06 05:54:26 +04:00
void AddColorStop(gfxFloat offset, const mozilla::gfx::Color& c);
void SetColorStops(mozilla::gfx::GradientStops* aStops);
// This should only be called on a cairo pattern that we want to use with
// Azure. We will read back the color stops from cairo and try to look
// them up in the cache.
void CacheColorStops(const mozilla::gfx::DrawTarget *aDT);
void SetMatrix(const gfxMatrix& matrix);
gfxMatrix GetMatrix() const;
gfxMatrix GetInverseMatrix() const;
/* Get an Azure Pattern for the current Cairo pattern. aPattern transform
* specifies the transform that was set on the DrawTarget when the pattern
* was set. When this is nullptr it is assumed the transform is identical
* to the current transform.
*/
mozilla::gfx::Pattern *GetPattern(const mozilla::gfx::DrawTarget *aTarget,
const mozilla::gfx::Matrix *aOriginalUserToDevice = nullptr);
bool IsOpaque();
// clamp, repeat, reflect
void SetExtend(mozilla::gfx::ExtendMode aExtend);
2005-04-06 05:54:26 +04:00
void SetSamplingFilter(mozilla::gfx::SamplingFilter aSamplingFilter);
mozilla::gfx::SamplingFilter SamplingFilter() const;
/* returns TRUE if it succeeded */
bool GetSolidColor(mozilla::gfx::Color& aColorOut);
private:
// Private destructor, to discourage deletion outside of Release():
~gfxPattern() {}
mozilla::gfx::GeneralPattern mGfxPattern;
Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat The bulk of this commit was generated with a script, executed at the top level of a typical source code checkout. The only non-machine-generated part was modifying MFBT's moz.build to reflect the new naming. CLOSED TREE makes big refactorings like this a piece of cake. # The main substitution. find . -name '*.cpp' -o -name '*.cc' -o -name '*.h' -o -name '*.mm' -o -name '*.idl'| \ xargs perl -p -i -e ' s/nsRefPtr\.h/RefPtr\.h/g; # handle includes s/nsRefPtr ?</RefPtr</g; # handle declarations and variables ' # Handle a special friend declaration in gfx/layers/AtomicRefCountedWithFinalize.h. perl -p -i -e 's/::nsRefPtr;/::RefPtr;/' gfx/layers/AtomicRefCountedWithFinalize.h # Handle nsRefPtr.h itself, a couple places that define constructors # from nsRefPtr, and code generators specially. We do this here, rather # than indiscriminantly s/nsRefPtr/RefPtr/, because that would rename # things like nsRefPtrHashtable. perl -p -i -e 's/nsRefPtr/RefPtr/g' \ mfbt/nsRefPtr.h \ xpcom/glue/nsCOMPtr.h \ xpcom/base/OwningNonNull.h \ ipc/ipdl/ipdl/lower.py \ ipc/ipdl/ipdl/builtin.py \ dom/bindings/Codegen.py \ python/lldbutils/lldbutils/utils.py # In our indiscriminate substitution above, we renamed # nsRefPtrGetterAddRefs, the class behind getter_AddRefs. Fix that up. find . -name '*.cpp' -o -name '*.h' -o -name '*.idl' | \ xargs perl -p -i -e 's/nsRefPtrGetterAddRefs/RefPtrGetterAddRefs/g' if [ -d .git ]; then git mv mfbt/nsRefPtr.h mfbt/RefPtr.h else hg mv mfbt/nsRefPtr.h mfbt/RefPtr.h fi --HG-- rename : mfbt/nsRefPtr.h => mfbt/RefPtr.h
2015-10-18 08:24:48 +03:00
RefPtr<mozilla::gfx::SourceSurface> mSourceSurface;
mozilla::gfx::Matrix mPatternToUserSpace;
Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat The bulk of this commit was generated with a script, executed at the top level of a typical source code checkout. The only non-machine-generated part was modifying MFBT's moz.build to reflect the new naming. CLOSED TREE makes big refactorings like this a piece of cake. # The main substitution. find . -name '*.cpp' -o -name '*.cc' -o -name '*.h' -o -name '*.mm' -o -name '*.idl'| \ xargs perl -p -i -e ' s/nsRefPtr\.h/RefPtr\.h/g; # handle includes s/nsRefPtr ?</RefPtr</g; # handle declarations and variables ' # Handle a special friend declaration in gfx/layers/AtomicRefCountedWithFinalize.h. perl -p -i -e 's/::nsRefPtr;/::RefPtr;/' gfx/layers/AtomicRefCountedWithFinalize.h # Handle nsRefPtr.h itself, a couple places that define constructors # from nsRefPtr, and code generators specially. We do this here, rather # than indiscriminantly s/nsRefPtr/RefPtr/, because that would rename # things like nsRefPtrHashtable. perl -p -i -e 's/nsRefPtr/RefPtr/g' \ mfbt/nsRefPtr.h \ xpcom/glue/nsCOMPtr.h \ xpcom/base/OwningNonNull.h \ ipc/ipdl/ipdl/lower.py \ ipc/ipdl/ipdl/builtin.py \ dom/bindings/Codegen.py \ python/lldbutils/lldbutils/utils.py # In our indiscriminate substitution above, we renamed # nsRefPtrGetterAddRefs, the class behind getter_AddRefs. Fix that up. find . -name '*.cpp' -o -name '*.h' -o -name '*.idl' | \ xargs perl -p -i -e 's/nsRefPtrGetterAddRefs/RefPtrGetterAddRefs/g' if [ -d .git ]; then git mv mfbt/nsRefPtr.h mfbt/RefPtr.h else hg mv mfbt/nsRefPtr.h mfbt/RefPtr.h fi --HG-- rename : mfbt/nsRefPtr.h => mfbt/RefPtr.h
2015-10-18 08:24:48 +03:00
RefPtr<mozilla::gfx::GradientStops> mStops;
nsTArray<mozilla::gfx::GradientStop> mStopsList;
mozilla::gfx::ExtendMode mExtend;
2005-04-06 05:54:26 +04:00
};
#endif /* GFX_PATTERN_H */