gfx/skia/trunk/include/views/SkOSWindow_Win.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.

     2 /*
     3  * Copyright 2006 The Android Open Source Project
     4  *
     5  * Use of this source code is governed by a BSD-style license that can be
     6  * found in the LICENSE file.
     7  */
    10 #ifndef SkOSWindow_Win_DEFINED
    11 #define SkOSWindow_Win_DEFINED
    13 #include "SkWindow.h"
    15 #if SK_ANGLE
    16 #include "EGL/egl.h"
    17 #endif
    19 class SkOSWindow : public SkWindow {
    20 public:
    21     SkOSWindow(void* hwnd);
    22     virtual ~SkOSWindow();
    24     void*   getHWND() const { return fHWND; }
    25     void    setSize(int width, int height);
    26     void    updateSize();
    28     static bool PostEvent(SkEvent* evt, SkEventSinkID, SkMSec delay);
    30     enum SkBackEndTypes {
    31         kNone_BackEndType,
    32 #if SK_SUPPORT_GPU
    33         kNativeGL_BackEndType,
    34 #if SK_ANGLE
    35         kANGLE_BackEndType,
    36 #endif // SK_ANGLE
    37 #endif // SK_SUPPORT_GPU
    38     };
    40     struct AttachmentInfo {
    41         int fSampleCount;
    42         int fStencilBits;
    43     };
    45     bool attach(SkBackEndTypes attachType, int msaaSampleCount, AttachmentInfo*);
    46     void detach();
    47     void present();
    49     bool wndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
    50     static bool QuitOnDeactivate(HWND hWnd);
    52     enum {
    53         SK_WM_SkEvent = WM_APP + 1000,
    54         SK_WM_SkTimerID = 0xFFFF    // just need a non-zero value
    55     };
    57 protected:
    58     virtual bool quitOnDeactivate() { return true; }
    60     // overrides from SkWindow
    61     virtual void onHandleInval(const SkIRect&);
    62     // overrides from SkView
    63     virtual void onAddMenu(const SkOSMenu*);
    65     virtual void onSetTitle(const char title[]);
    67 private:
    68     void*               fHWND;
    70     void                doPaint(void* ctx);
    72 #if SK_SUPPORT_GPU
    73     void*               fHGLRC;
    74 #if SK_ANGLE
    75     EGLDisplay          fDisplay;
    76     EGLContext          fContext;
    77     EGLSurface          fSurface;
    78     EGLConfig           fConfig;
    79 #endif // SK_ANGLE
    80 #endif // SK_SUPPORT_GPU
    82     HMENU               fMBar;
    84     SkBackEndTypes      fAttached;
    86 #if SK_SUPPORT_GPU
    87     bool attachGL(int msaaSampleCount, AttachmentInfo* info);
    88     void detachGL();
    89     void presentGL();
    91 #if SK_ANGLE
    92     bool attachANGLE(int msaaSampleCount, AttachmentInfo* info);
    93     void detachANGLE();
    94     void presentANGLE();
    95 #endif // SK_ANGLE
    96 #endif // SK_SUPPORT_GPU
    98     typedef SkWindow INHERITED;
    99 };
   101 #endif

mercurial