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

michael@0 1 /*
michael@0 2 * Copyright 2006 The Android Open Source Project
michael@0 3 *
michael@0 4 * Use of this source code is governed by a BSD-style license that can be
michael@0 5 * found in the LICENSE file.
michael@0 6 */
michael@0 7
michael@0 8 #ifndef SkOSWindow_Unix_DEFINED
michael@0 9 #define SkOSWindow_Unix_DEFINED
michael@0 10
michael@0 11 #include <GL/glx.h>
michael@0 12 #include <X11/Xlib.h>
michael@0 13
michael@0 14 #include "SkWindow.h"
michael@0 15
michael@0 16 class SkEvent;
michael@0 17
michael@0 18 struct SkUnixWindow {
michael@0 19 Display* fDisplay;
michael@0 20 Window fWin;
michael@0 21 size_t fOSWin;
michael@0 22 GC fGc;
michael@0 23 GLXContext fGLContext;
michael@0 24 };
michael@0 25
michael@0 26 class SkOSWindow : public SkWindow {
michael@0 27 public:
michael@0 28 SkOSWindow(void*);
michael@0 29 ~SkOSWindow();
michael@0 30
michael@0 31 void* getHWND() const { return (void*)fUnixWindow.fWin; }
michael@0 32 void* getDisplay() const { return (void*)fUnixWindow.fDisplay; }
michael@0 33 void* getUnixWindow() const { return (void*)&fUnixWindow; }
michael@0 34 void loop();
michael@0 35
michael@0 36 enum SkBackEndTypes {
michael@0 37 kNone_BackEndType,
michael@0 38 kNativeGL_BackEndType,
michael@0 39 };
michael@0 40
michael@0 41 struct AttachmentInfo {
michael@0 42 int fSampleCount;
michael@0 43 int fStencilBits;
michael@0 44 };
michael@0 45
michael@0 46 bool attach(SkBackEndTypes attachType, int msaaSampleCount, AttachmentInfo*);
michael@0 47 void detach();
michael@0 48 void present();
michael@0 49
michael@0 50 int getMSAASampleCount() const { return fMSAASampleCount; }
michael@0 51
michael@0 52 //static bool PostEvent(SkEvent* evt, SkEventSinkID, SkMSec delay);
michael@0 53
michael@0 54 protected:
michael@0 55 // Overridden from from SkWindow:
michael@0 56 virtual void onSetTitle(const char title[]) SK_OVERRIDE;
michael@0 57
michael@0 58 private:
michael@0 59 enum NextXEventResult {
michael@0 60 kContinue_NextXEventResult,
michael@0 61 kQuitRequest_NextXEventResult,
michael@0 62 kPaintRequest_NextXEventResult
michael@0 63 };
michael@0 64
michael@0 65 NextXEventResult nextXEvent();
michael@0 66 void doPaint();
michael@0 67 void mapWindowAndWait();
michael@0 68
michael@0 69 void closeWindow();
michael@0 70 void initWindow(int newMSAASampleCount, AttachmentInfo* info);
michael@0 71
michael@0 72 SkUnixWindow fUnixWindow;
michael@0 73
michael@0 74 // Needed for GL
michael@0 75 XVisualInfo* fVi;
michael@0 76 // we recreate the underlying xwindow if this changes
michael@0 77 int fMSAASampleCount;
michael@0 78
michael@0 79 typedef SkWindow INHERITED;
michael@0 80 };
michael@0 81
michael@0 82 #endif

mercurial