gfx/skia/trunk/src/utils/debugger/SkObjectParser.h

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

     1 /*
     2  * Copyright 2012 Google Inc.
     3  *
     4  * Use of this source code is governed by a BSD-style license that can be
     5  * found in the LICENSE file.
     6  */
     8 #ifndef SKOBJECTPARSER_H_
     9 #define SKOBJECTPARSER_H_
    11 #include "SkCanvas.h"
    12 #include "SkString.h"
    14 /** \class SkObjectParser
    16     The ObjectParser is used to return string information about parameters
    17     in each draw command.
    18  */
    19 class SkObjectParser {
    20 public:
    22     /**
    23         Returns a string about a bitmaps bounds and config.
    24         @param bitmap  SkBitmap
    25     */
    26     static SkString* BitmapToString(const SkBitmap& bitmap);
    28     /**
    29         Returns a string representation of a boolean.
    30         @param doAA  boolean
    31      */
    32     static SkString* BoolToString(bool doAA);
    34     /**
    35         Returns a string representation of the text pointer passed in.
    36      */
    37     static SkString* CustomTextToString(const char* text);
    39     /**
    40         Returns a string representation of an integer with the text parameter
    41         at the front of the string.
    42         @param x  integer
    43         @param text
    44      */
    45     static SkString* IntToString(int x, const char* text);
    46     /**
    47         Returns a string representation of the SkIRects coordinates.
    48         @param rect  SkIRect
    49      */
    50     static SkString* IRectToString(const SkIRect& rect);
    52     /**
    53         Returns a string representation of an SkMatrix's contents
    54         @param matrix  SkMatrix
    55      */
    56     static SkString* MatrixToString(const SkMatrix& matrix);
    58     /**
    59         Returns a string representation of an SkPaint's color
    60         @param paint  SkPaint
    61      */
    62     static SkString* PaintToString(const SkPaint& paint);
    64     /**
    65         Returns a string representation of a SkPath's points.
    66         @param path  SkPath
    67      */
    68     static SkString* PathToString(const SkPath& path);
    70     /**
    71         Returns a string representation of the points in the point array.
    72         @param pts[]  Array of SkPoints
    73         @param count
    74      */
    75     static SkString* PointsToString(const SkPoint pts[], size_t count);
    77     /**
    78         Returns a string representation of the SkCanvas PointMode enum.
    79      */
    80     static SkString* PointModeToString(SkCanvas::PointMode mode);
    82     /**
    83         Returns a string representation of the SkRects coordinates.
    84         @param rect  SkRect
    85      */
    86     static SkString* RectToString(const SkRect& rect, const char* title = NULL);
    88     /**
    89         Returns a string representation of an SkRRect.
    90         @param rrect  SkRRect
    91      */
    92     static SkString* RRectToString(const SkRRect& rrect, const char* title = NULL);
    94     /**
    95         Returns a string representation of the SkRegion enum.
    96         @param op  SkRegion::op enum
    97      */
    98     static SkString* RegionOpToString(SkRegion::Op op);
   100     /**
   101         Returns a string representation of the SkRegion.
   102         @param region  SkRegion
   103      */
   104     static SkString* RegionToString(const SkRegion& region);
   106     /**
   107         Returns a string representation of the SkCanvas::SaveFlags enum.
   108         @param flags  SkCanvas::SaveFlags enum
   109      */
   110     static SkString* SaveFlagsToString(SkCanvas::SaveFlags flags);
   112     /**
   113         Returns a string representation of an SkScalar with the text parameter
   114         at the front of the string.
   115         @param x  SkScalar
   116         @param text
   117      */
   118     static SkString* ScalarToString(SkScalar x, const char* text);
   120     /**
   121         Returns a string representation of the char pointer passed in.
   122         @param text  const void* that will be cast to a char*
   123      */
   124     static SkString* TextToString(const void* text, size_t byteLength,
   125                                   SkPaint::TextEncoding encoding);
   126 };
   128 #endif

mercurial