Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  SkAutoBlitterChoose.h

  Sprache: C
 

/*
 * Copyright 2017 Google LLC
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */


#ifndef SkAutoBlitterChoose_DEFINED
#define SkAutoBlitterChoose_DEFINED

#include "include/private/base/SkMacros.h"
#include "src/base/SkArenaAlloc.h"
#include "src/core/SkBlitter.h"
#include "src/core/SkDraw.h"
#include "src/core/SkRasterClip.h"
#include "src/core/SkSurfacePriv.h"

class SkMatrix;
class SkPaint;
class SkPixmap;

// This was determined experimentally by adding logging to SkSTArenaAlloc's destructor
// to see what the biggest size observed was while doing some browsing on Chromium.
// It's a bit tricky to determine this value statically, as the SkRasterPipelineBuilder
// uses the allocator for several things, as do the shaders which make use of the legacy
// shader context. In other cases it's easier because the allocator only has the blitter
// itself and one could do a static_assert using sizeof().
using SkBlitterSizedArena = SkSTArenaAlloc<2736>;

class [[nodiscard]] SkAutoBlitterChoose : SkNoncopyable {
public:
    SkAutoBlitterChoose() {}
    SkAutoBlitterChoose(const skcpu::Draw& draw,
                        const SkMatrix* ctm,
                        const SkPaint& paint,
                        const SkRect& devBounds,
                        SkDrawCoverage drawCoverage = SkDrawCoverage::kNo) {
        this->choose(draw, ctm, paint, devBounds, drawCoverage);
    }

    SkBlitter*  operator->() { return fBlitter; }
    SkBlitter*  get() const { return fBlitter; }

    SkBlitter* choose(const skcpu::Draw& draw,
                      const SkMatrix* ctm,
                      const SkPaint& paint,
                      const SkRect& devBounds,
                      SkDrawCoverage drawCoverage = SkDrawCoverage::kNo) {
        SkASSERT(!fBlitter);
        fBlitter = draw.fBlitterChooser(draw.fDst,
                                        ctm ? *ctm : *draw.fCTM,
                                        paint,
                                        &fAlloc,
                                        drawCoverage,
                                        draw.fRC->clipShader(),
                                        SkSurfacePropsCopyOrDefault(draw.fProps),
                                        devBounds);
        return fBlitter;
    }

private:
    // Owned by fAlloc, which will handle the delete.
    SkBlitter* fBlitter = nullptr;

    SkBlitterSizedArena fAlloc;
};

#endif

Messung V0.5 in Prozent
C=100 H=100 G=100

¤ Dauer der Verarbeitung: 0.3 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

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 und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik

Statistik
#Sources=277311
#Domains=752002