/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*- * 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/. */
#include"gfxDrawable.h" #include"gfxContext.h" #include"gfxPlatform.h" #include"gfx2DGlue.h" #ifdef MOZ_X11 # include "cairo.h" # include "gfxXlibSurface.h" #endif #include"mozilla/gfx/Logging.h"
// When drawing with CLAMP we can expand the sampling rect to the nearest // pixel without changing the result.
IntRect intRect =
IntRect::RoundOut(aSamplingRect.X(), aSamplingRect.Y(),
aSamplingRect.Width(), aSamplingRect.Height());
IntSize size = mSourceSurface->GetSize(); if (!IntRect(IntPoint(), size).Contains(intRect)) { returnfalse;
}
if (IsRepeatingExtendMode(aExtendMode)) { // We can't use mPattern directly: We want our repeated tiles to have // the size mSize, which might not be the case in mPattern. // So we need to draw mPattern into a surface of size mSize, create // a pattern from the surface and draw that pattern. // gfxCallbackDrawable and gfxSurfaceDrawable already know how to do // those things, so we use them here. Drawing mPattern into the surface // will happen through this Draw() method with aRepeat = false.
RefPtr<gfxCallbackDrawable> callbackDrawable = MakeCallbackDrawable(); return callbackDrawable->Draw(aContext, aFillRect, aExtendMode,
aSamplingFilter, aOpacity, aTransform);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.