[haiku-commits] BRANCH looncraz-github.CAP-dirty [69aac4bcdc55] in src/servers/app/drawing/interface/local: . src/servers/app

  • From: looncraz-github.CAP-dirty <community@xxxxxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Fri, 20 Mar 2015 20:46:39 +0100 (CET)

added 2 changesets to branch 'refs/remotes/looncraz-github/CAP-dirty'
old head: 0000000000000000000000000000000000000000
new head: 69aac4bcdc55c46ebf3cbe0541cf5f68ab7dfd5f
overview: https://github.com/looncraz/haiku/compare/69aac4bcdc55

----------------------------------------------------------------------------

4f66064662ca: Place saver
  
  Create dirty branch to make quick saves that are more volatile than
  CAP-volatile...
  
  yeah, seriously!

69aac4bcdc55: Pick up some dirty  stragglers

                                        [ looncraz <looncraz@xxxxxxxxxxxx> ]

----------------------------------------------------------------------------

9 files changed, 541 insertions(+), 80 deletions(-)
src/servers/app/Desktop.cpp                      |  11 +-
src/servers/app/Desktop.h                        |   2 +
src/servers/app/Window.cpp                       |  78 +++-----
src/servers/app/Window.h                         |  39 ++--
.../drawing/interface/local/CompositeEngine.h    |  34 ++++
.../interface/local/CompositeHWInterface.cpp     | 132 ++++++++++++++
.../interface/local/CompositeHWInterface.h       |  92 ++++++++++
.../drawing/interface/local/CompositeWindow.cpp  | 178 +++++++++++++++++++
.../drawing/interface/local/CompositeWindow.h    |  55 ++++++

############################################################################

Commit:      4f66064662ca0c40716e144615c393db0631cdfe
Author:      looncraz <looncraz@xxxxxxxxxxxx>
Date:        Fri Mar 20 19:37:09 2015 UTC

Place saver

Create dirty branch to make quick saves that are more volatile than
CAP-volatile...

yeah, seriously!

----------------------------------------------------------------------------

diff --git a/src/servers/app/Desktop.cpp b/src/servers/app/Desktop.cpp
index 808ac92..26d1a78 100644
--- a/src/servers/app/Desktop.cpp
+++ b/src/servers/app/Desktop.cpp
@@ -437,7 +437,8 @@ Desktop::Desktop(uid_t userID, const char* targetScreen)
 
        fFocus(NULL),
        fFront(NULL),
-       fBack(NULL)
+       fBack(NULL),
+       fCompositingEnabled(false)
 {
        memset(fLastWorkspaceFocus, 0, sizeof(fLastWorkspaceFocus));
 
@@ -3267,8 +3268,12 @@ Desktop::RebuildAndRedrawAfterWindowChange(Window* 
changedWindow,
                                        B_DIRECT_MODIFY | B_CLIPPING_MODIFIED);
                        }
 
-                       // that windows region is not available on screen 
anymore
-                       
stillAvailableOnScreen.Exclude(&window->VisibleRegion());
+                       // remove clipping region from non-alpha window regions 
so windows
+                       // beneath this one do not draw needlessly
+                       if (fCompositingEnabled && window->IsCompositeWindow())
+                               
stillAvailableOnScreen.Exclude(&window->NonAlphaVisibleRegion());
+                       else
+                               
stillAvailableOnScreen.Exclude(&window->VisibleRegion());
                }
        }
 
diff --git a/src/servers/app/Desktop.h b/src/servers/app/Desktop.h
index 5c7b565..338f9f3 100644
--- a/src/servers/app/Desktop.h
+++ b/src/servers/app/Desktop.h
@@ -356,6 +356,8 @@ private:
                        Window*                         fFront;
                        Window*                         fBack;
 
+                       bool                            fCompositingEnabled;
+
                        StackAndTile            fStackAndTile;
 };
 
diff --git a/src/servers/app/Window.cpp b/src/servers/app/Window.cpp
index a4c6e88..0623242 100644
--- a/src/servers/app/Window.cpp
+++ b/src/servers/app/Window.cpp
@@ -127,8 +127,7 @@ Window::Window(const BRect& frame, const char *name,
        fMinHeight(1),
        fMaxHeight(32768),
 
-       fWorkspacesViewCount(0),
-       fWindowBuffer(NULL)
+       fWorkspacesViewCount(0)
 {
        _InitWindowStack();
 
@@ -190,7 +189,6 @@ Window::~Window()
 
        delete fWindowBehaviour;
        delete fDrawingEngine;
-       delete fWindowBuffer;
 
        gDecorManager.CleanupForWindow(this);
 }
@@ -223,6 +221,27 @@ Window::SetClipping(BRegion* stillAvailableOnScreen)
 
 
 void
+Window::SetAlphaRegion(BRegion* alphaRegion)
+{
+       // called by ServerWindow due to a client request/command
+       fAlphaRegion = BRegion(*alphaRegion);
+}
+
+
+BRegion
+Window::NonAlphaVisibleRegion()
+{
+       // clipping must be read locked when this is called
+       if (fAlphaRegion.CountRects() == 0)
+               return fVisibleRegion;
+
+       BRegion nonAlphaVisibleRegion(fVisibleRegion);
+       nonAlphaVisibleRegion.Exclude(&fAlphaRegion);
+       return nonAlphaVisibleRegion;
+}
+
+
+void
 Window::GetFullRegion(BRegion* region)
 {
        // TODO: if someone needs to call this from
@@ -601,53 +620,6 @@ Window::Decorator() const
 
 
 bool
-Window::SetWindowBufferEnabled(bool enable)
-{
-       if ((Flags() & B_NO_BUFFERED_DRAWING) != 0)
-               return false;
-
-       // already enabled/disabled? Then we're done!
-       if ((enable && IsWindowBufferEnabled())
-               || (!enable && !IsWindowBufferEnabled()))
-               return true;
-
-       ::Decorator* decorator = Decorator();
-
-       // DrawingEngine's SetDrawingBuffer handles the locking.
-       if (enable) {
-               if (fWindowBuffer == NULL)
-                       fWindowBuffer = new(std::nothrow) ::WindowBuffer(this);
-
-               // TODO!  This code doesn't take into account the future
-               // requirement of having fDecorator draw in the WindowBuffer
-               // along with the Window.
-
-               if (decorator != NULL) {
-                       fDecoratorDrawingEngine
-                               = 
fDesktop->HWInterface()->CreateDrawingEngine();
-                       decorator->SetDrawingEngine(fDecoratorDrawingEngine);
-               }
-
-               fDrawingEngine->SetDrawingBuffer(fWindowBuffer);
-       } else {
-               if (fDecoratorDrawingEngine != fDrawingEngine)
-                       delete fDecoratorDrawingEngine;
-
-               fDecoratorDrawingEngine = fDrawingEngine;
-               if (decorator != NULL)
-                       decorator->SetDrawingEngine(fDecoratorDrawingEngine);
-
-               fDrawingEngine->SetDrawingBuffer(NULL);
-               delete fWindowBuffer;
-               fWindowBuffer = NULL;
-       }
-
-       ServerWindow()->RequestRedraw();
-       return true;
-}
-
-
-bool
 Window::ReloadDecor()
 {
        ::Decorator* decorator = NULL;
@@ -2027,9 +1999,6 @@ Window::BeginUpdate(BPrivate::PortLink& link)
 //snooze(10000);
 //}
 
-       if (IsWindowBufferEnabled())
-               fWindowBuffer->ClientDrawLock();
-
        link.StartMessage(B_OK);
        // append the current window geometry to the
        // message, the client will need it
@@ -2066,9 +2035,6 @@ Window::EndUpdate()
        // NOTE: see comment in _BeginUpdate()
 
        if (fInUpdate) {
-               if (IsWindowBufferEnabled())
-                       fWindowBuffer->ClientDrawUnlock();
-
                // reenable copy to front
                fDrawingEngine->SetCopyToFrontEnabled(true);
 
diff --git a/src/servers/app/Window.h b/src/servers/app/Window.h
index 6086a3d..7027340 100644
--- a/src/servers/app/Window.h
+++ b/src/servers/app/Window.h
@@ -107,13 +107,8 @@ public:
                        ::ServerWindow*         ServerWindow() const { return 
fWindow; }
                        ::EventTarget&          EventTarget() const
                                                                        { 
return fWindow->EventTarget(); }
-                       ::WindowBuffer*         WindowBuffer() const
-                                                                       { 
return fWindowBuffer; }
 
-                       bool                            
SetWindowBufferEnabled(bool enable);
-                       
-                       bool                            IsWindowBufferEnabled() 
const
-                                                                       {       
return WindowBuffer() != NULL;  }
+       virtual bool                            IsCompositeWindow() const { 
return false; }
 
                        bool                            ReloadDecor();
 
@@ -123,8 +118,11 @@ public:
                        // setting and getting the "hard" clipping, you need to 
have
                        // WriteLock()ed the clipping!
                        void                            SetClipping(BRegion* 
stillAvailableOnScreen);
+                       void                            SetAlphaRegion(BRegion* 
alphaRegion);
                        // you need to have ReadLock()ed the clipping!
        inline  BRegion&                        VisibleRegion() { return 
fVisibleRegion; }
+                       BRegion                         NonAlphaVisibleRegion();
+       inline  BRegion&                        AlphaRegion() { return 
fAlphaRegion; }
                        BRegion&                        VisibleContentRegion();
 
                        // TODO: not protected by a lock, but noone should need 
this anyways
@@ -134,7 +132,7 @@ public:
                        void                            
GetContentRegion(BRegion* region);
 
                        void                            MoveBy(int32 x, int32 
y, bool moveStack = true);
-                       void                            ResizeBy(int32 x, int32 
y,
+       virtual void                            ResizeBy(int32 x, int32 y,
                                                                        
BRegion* dirtyRegion,
                                                                        bool 
resizeStack = true);
 
@@ -146,14 +144,14 @@ public:
 
        virtual bool                            IsOffscreenWindow() const { 
return false; }
 
-                       void                            
GetEffectiveDrawingRegion(View* view,
+       virtual void                            GetEffectiveDrawingRegion(View* 
view,
                                                                        
BRegion& region);
                        bool                            
DrawingRegionChanged(View* view) const;
 
                        // generic version, used by the Desktop
-                       void                            
ProcessDirtyRegion(BRegion& regionOnScreen);
-                       void                            RedrawDirtyRegion();
-                       
+       virtual void                            ProcessDirtyRegion(BRegion& 
regionOnScreen);
+       virtual void                            RedrawDirtyRegion();
+
                        // Draw from WindowBuffer to the frame buffer
                        void                            DrawFromBuffer(BRegion* 
drawingRegion);
 
@@ -169,8 +167,8 @@ public:
                        void                            DisableUpdateRequests();
                        void                            EnableUpdateRequests();
 
-                       void                            
BeginUpdate(BPrivate::PortLink& link);
-                       void                            EndUpdate();
+       virtual void                            BeginUpdate(BPrivate::PortLink& 
link);
+       virtual void                            EndUpdate();
                        bool                            InUpdate() const
                                                                        { 
return fInUpdate; }
 
@@ -213,7 +211,7 @@ public:
                        void                            
WorkspaceActivated(int32 index, bool active);
                        void                            
WorkspacesChanged(uint32 oldWorkspaces,
                                                                        uint32 
newWorkspaces);
-                       void                            Activated(bool active);
+       virtual void                            Activated(bool active);
 
                        // changing some properties
                        void                            SetTitle(const char* 
name, BRegion& dirty);
@@ -221,13 +219,13 @@ public:
                        void                            SetFocus(bool focus);
                        bool                            IsFocus() const { 
return fIsFocus; }
 
-                       void                            SetHidden(bool hidden);
+       virtual void                            SetHidden(bool hidden);
        inline  bool                            IsHidden() const { return 
fHidden; }
 
                        void                            SetShowLevel(int32 
showLevel);
        inline  int32                           ShowLevel() const { return 
fShowLevel; }
 
-                       void                            SetMinimized(bool 
minimized);
+       virtual void                            SetMinimized(bool minimized);
        inline  bool                            IsMinimized() const { return 
fMinimized; }
 
                        void                            
SetCurrentWorkspace(int32 index)
@@ -261,7 +259,7 @@ public:
                        void                            SetLook(window_look 
look,
                                                                        
BRegion* updateRegion);
                        void                            SetFeel(window_feel 
feel);
-                       void                            SetFlags(uint32 flags, 
BRegion* updateRegion);
+       virtual void                            SetFlags(uint32 flags, BRegion* 
updateRegion);
 
                        window_look                     Look() const { return 
fLook; }
                        window_feel                     Feel() const { return 
fFeel; }
@@ -346,10 +344,10 @@ public:
                        void                    ConvertScreenToDrawing(BRegion* 
region) const;
                        void                    ConvertScreenToWindow(BRect* 
rect) const;
                        void                    ConvertScreenToWindow(BRegion* 
region) const;
-                       
+
                        void                    ConvertDrawingToScreen(BRect* 
rect) const;
                        void                    ConvertDrawingToScreen(BRegion* 
region) const;
-                       
+
 
 protected:
                        void                            
_ShiftPartOfRegion(BRegion* region,
@@ -382,6 +380,7 @@ protected:
                        // has to be called
 
                        BRegion                         fVisibleRegion;
+                       BRegion                         fAlphaRegion;
                        BRegion                         fVisibleContentRegion;
                        // our part of the "global" dirty region
                        // it is calculated from the desktop thread,
@@ -474,8 +473,6 @@ protected:
 
                        int32                           fWorkspacesViewCount;
 
-                       ::WindowBuffer*         fWindowBuffer;
-               
                friend class DecorManager;
 
 private:
diff --git a/src/servers/app/drawing/interface/local/CompositeEngine.h 
b/src/servers/app/drawing/interface/local/CompositeEngine.h
new file mode 100644
index 0000000..f63ad2d
--- /dev/null
+++ b/src/servers/app/drawing/interface/local/CompositeEngine.h
@@ -0,0 +1,34 @@
+#ifndef CAP_COMPOSITE_ENGINE_H
+#define CAP_COMPOSITE_ENGINE_H
+
+/*
+       For each Desktop (ScreenOwner) that has compositing enabled, it will
+       create its own dedicated CompositeEngine.
+*/
+
+class CompositeEngineClient{
+public:
+       virtual void                            CompositingEnabled(bool 
enabled) = 0;
+       virtual void                            CompositingEnabling() = 0;
+       virtual void                            CompositingDisabling() = 0;
+};
+
+
+class CompositeEngine{
+public:
+                                                               CompositeEngine 
();
+       virtual                                         ~CompositeEngine();
+
+       virtual status_t                SetDPMSMode(uint32 state);
+
+       virtual void                    SetCursor(ServerCursor* cursor);
+       virtual void                    SetCursorVisible(bool);
+       virtual void                    MoveCursorTo(float, float);
+
+       virtual void                    SetDragBitmap(const ServerBitmap* 
bitmap,
+                                                               const BPoint& 
offsetFromCursor);
+
+};
+
+
+#endif // CAP_COMPOSITE_ENGINE_H
diff --git a/src/servers/app/drawing/interface/local/CompositeHWInterface.cpp 
b/src/servers/app/drawing/interface/local/CompositeHWInterface.cpp
new file mode 100644
index 0000000..0bc187b
--- /dev/null
+++ b/src/servers/app/drawing/interface/local/CompositeHWInterface.cpp
@@ -0,0 +1,132 @@
+#include <Accelerant.h>
+
+#include "CompositeEngine.h"
+#include "CompositeHWInterface.h"
+#include "CompositeWindow.h"
+#include "DrawingEngine.h"
+
+
+#include "RapidDebug.h"
+
+
+CompositeHWInterface::CompositeHWInterface(Desktop* desktop)
+       :
+       AccelerantHWInterface(),
+       fDesktop(desktop)
+       {
+
+       }
+
+
+CompositeHWInterface::~CompositeHWInterface()
+{
+
+}
+
+
+
+DrawingEngine*
+CompositeHWInterface::CreateDrawingEngine()
+{
+       return new (std::nothrow) DrawingEngine(this);
+}
+
+
+DrawingEngine*
+CompositeHWInterface::CreateDrawingEngine(CompositeWindow* window)
+{
+       DrawingEngine* engine = new (std::nothrow) DrawingEngine(this);
+       engine->SetDrawingBuffer(window->DrawingBuffer());
+}
+
+
+status_t
+CompositeHWInterface::Initialize()
+{
+
+       return AccelerantHWInterface::Initialize();
+}
+
+
+status_t
+CompositeHWInterface::Shutdown()
+{
+       return AccelerantHWInterface::Shutdown();
+}
+
+
+// if screen is off, stop the compositing...
+// if comes back on... bring it back
+status_t
+CompositeHWInterface::SetDPMSMode(uint32 state)
+{
+       status_t error = AccelerantHWInterface::SetDPMSMode(state);
+
+       if (fDesktop == NULL)
+               return B_ERROR;
+
+       /*
+               The CompositeEngine doesn't always care if the accelerant failed
+               to set the DPMS mode for the display, it can possibly use the 
mode
+               set events themselves to change the target refresh rate (since 
a suspend
+                       or standby event means the screen should be sleeping 
now).
+       */
+
+       return fDesktop->CompositeEngine()->SetDPMSMode(state, error);
+}
+
+
+void
+CompositeHWInterface::SetCursor(ServerCursor* cursor)
+{
+       /*
+               When compositing a software cursor can be a very nasty thing, 
indeed!
+               As such, the compositer must handle the timing (in the very 
least) of
+               the cursor draws and must be aware of any changes in the cursor.
+       */
+       if (fDesktop != NULL)
+               fDesktop->CompositeEngine()->SetCursor(cursor);
+
+       AccelerantHWInterface::SetCursor(cursor);
+}
+
+
+void
+CompositeHWInterface::SetCursorVisible(bool x)
+{
+       if (fDesktop != NULL)
+               fDesktop->CompositeEngine()->SetCursorVisible(x);
+
+       AccelerantHWInterface::SetCursorVisible(x);
+}
+
+
+void
+CompositeHWInterface::MoveCursorTo(float x, float y)
+{
+       fDesktop->CompositeEngine()->MoveCursorTo(x,y);
+       AccelerantHWInterface::MoveCursorTo(x,y);
+}
+
+
+void
+CompositeHWInterface::SetDragBitmap(const ServerBitmap* bitmap,
+                                       const BPoint& offset)
+{
+       AccelerantHWInterface::SetDragBitmap(bitmap, offset);
+       // TODO: create server-side exclusive CompositeOverlay
+       // for dragging bitmaps - IF NEEDED...
+}
+
+
+void
+CompositeHWInterface::_DrawCursor(IntRect area) const
+{
+       if (fDesktop->CompositeEngine()->RedrawCursorOverlay(area) == false)
+               AccelerantHWInterface::_DrawCursor(area);
+
+       // if the CompositeEngine has a mouse handler (overlay), use it,
+       // otherwise revert to the AccelerantHWInterface's _DrawCursor()
+}
+
+
diff --git a/src/servers/app/drawing/interface/local/CompositeHWInterface.h 
b/src/servers/app/drawing/interface/local/CompositeHWInterface.h
new file mode 100644
index 0000000..569f353
--- /dev/null
+++ b/src/servers/app/drawing/interface/local/CompositeHWInterface.h
@@ -0,0 +1,92 @@
+#ifndef COMPOSITE_HW_INTERFACE_H
+#define COMPOSITE_HW_INTERFACE_H
+
+#include <ObjectList.h>
+
+#include "HWInterface.h"
+#include "Desktop,h"
+
+class CompositeWindow;
+
+/*
+       CompositeHWInterface
+               One of these is created per compositing window.
+*/
+
+
+class CompositeHWInterface : public HWInterface {
+public:
+                                                               
CompositeHWInterface    (CompositeWindow*);
+       virtual                                         ~CompositeHWInterface   
();
+
+               DrawingEngine*                  CreateDrawingEngine();
+
+       virtual status_t                        Initialize();
+       virtual status_t                        Shutdown();
+
+       virtual uint32                          AvailableHWAcceleration() const;
+
+       virtual RenderingBuffer*        FrontBuffer() const;
+       virtual RenderingBuffer*        BackBuffer() const;
+
+       virtual void                            ResizeBy(int32, int32);
+
+protected:
+
+private:
+                       CompositeWindow*        fWindow;
+                       WindowBuffer*           fFrontBuffer;
+                       WindowBuffer*           fBackBuffer;
+
+public:
+       /*
+               A lot of stuff we don't care about...
+               We must implement this for HWInterface, but 
CompositeHWInterface uses
+               the AccelerantHWInterface to interact with the standard 2D 
accelerant,
+               and will only directly interfaces with its own specialized 
accelerant
+               once such a thing exists...
+       */
+
+       virtual status_t                        SetMode(const display_mode& 
mode)
+                                                                       { 
return B_OK; }
+       virtual void                            GetMode(display_mode* mode)     
{}
+
+       virtual status_t                        
GetDeviceInfo(accelerant_device_info* info)
+                                                                       {return 
B_NOT_SUPPORTED;}
+
+       virtual status_t                        GetFrameBufferConfig(
+                                                                       
frame_buffer_config& config)
+                                                                       { 
return B_NOT_SUPPORTED; }
+       virtual status_t                        GetModeList(display_mode** 
_modeList,
+                                                                       uint32* 
_count)
+                                                                       { 
return B_NOT_SUPPORTED; }
+       virtual status_t                        
GetPixelClockLimits(display_mode* mode,
+                                                                       uint32* 
_low, uint32* _high)
+                                                                       { 
return B_NOT_SUPPORTED; }
+       virtual status_t                        
GetTimingConstraints(display_timing_constraints*
+                                                                       
constraints)
+                                                                       { 
return B_NOT_SUPPORTED; }
+       virtual status_t                        ProposeMode(display_mode* 
candidate,
+                                                                       const 
display_mode* low,
+                                                                       const 
display_mode* high)
+                                                                       { 
return B_NOT_SUPPORTED; }
+
+       virtual sem_id                          RetraceSemaphore() { return -1; 
}
+       virtual status_t                        WaitForRetrace(
+                                                                       
bigtime_t timeout = B_INFINITE_TIMEOUT)
+                                                                       { 
return B_OK; }
+
+       virtual status_t                        SetDPMSMode(uint32 state)
+                                                                       { 
return B_NOT_SUPPORTED; }
+
+       virtual uint32                          DPMSMode()
+                                                                       { 
return B_DPMS_ON; }
+       virtual uint32                          DPMSCapabilities()
+                                                                       { 
return B_DPMS_ON; }
+
+       virtual void                            Sync() {}
+
+
+};
+
+#endif
diff --git a/src/servers/app/drawing/interface/local/CompositeWindow.h 
b/src/servers/app/drawing/interface/local/CompositeWindow.h
new file mode 100644
index 0000000..efb4a09
--- /dev/null
+++ b/src/servers/app/drawing/interface/local/CompositeWindow.h
@@ -0,0 +1,55 @@
+#ifndef CAP_COMPOSITE_WINDOW_H
+#define CAP_COMPOSITE_WINDOW_H
+
+#include <Region.h>
+
+#include "CompositeEngineClient.h"
+#include "Window.h"
+
+
+class CompositeWindow : public Window, public CompositeEngineClient{
+public:
+                                                               
CompositeWindow(BRect, const char* name,
+                                                                               
window_look, window_feel,
+                                                                               
uint32 flags, uint32 wspaces,
+                                                                               
::ServerWindow* window,
+                                                                               
CompositeHWInterface* hwInterface);
+       virtual                                         ~CompositeWindow();
+
+
+       virtual void                            BeginUpdate(BPrivate::PortLink& 
link);
+       virtual void                            EndUpdate();
+
+       virtual bool                            ReloadDecor();
+
+       virtual void                            GetEffectiveDrawingRegion(View* 
view,
+                                                                       
BRegion& region);
+
+       virtual void                            ProcessDirtyRegion(BRegion& 
regionOnScreen);
+       virtual void                            RedrawDirtyRegion();
+
+       virtual void                            Activated(bool activated);
+       virtual void                            SetHidden(bool hidden);
+       virtual void                            SetMinimized(bool minimized);
+
+       virtual void                            ResizeBy(int32 x, int32 y,
+                                                                       
BRegion* dirtyRegion,
+                                                                       bool 
resizeStack = true);
+
+       virtual void                            SetFlags(uint32 flags, BRegion* 
updateRegion);
+       protected:
+       virtual void                            CompositingEnabled(bool);
+       virtual void                            CompositingEnabling();
+       virtual void                            CompositingDisabling();
+
+       // convert to WindowBuffer coordinate space
+       virtual void                            ConvertForDrawing(BPoint* 
point) const;
+       virtual void                            ConvertForDrawing(BRect* rect) 
const;
+       virtual void                            ConvertForDrawing(BRegion* 
region) const;
+       virtual void                            ConvertForDrawing(IntRect* 
rect) const;
+
+private:
+                       CompositeHWInterface*   fGraphicsCard;
+};
+
+#endif // CAP_COMPOSITE_WINDOW_H

############################################################################

Commit:      69aac4bcdc55c46ebf3cbe0541cf5f68ab7dfd5f
Author:      looncraz <looncraz@xxxxxxxxxxxx>
Date:        Fri Mar 20 19:40:31 2015 UTC

Pick up some dirty  stragglers

----------------------------------------------------------------------------

diff --git a/src/servers/app/drawing/interface/local/CompositeHWInterface.h 
b/src/servers/app/drawing/interface/local/CompositeHWInterface.h
index 569f353..fe009db 100644
--- a/src/servers/app/drawing/interface/local/CompositeHWInterface.h
+++ b/src/servers/app/drawing/interface/local/CompositeHWInterface.h
@@ -29,7 +29,7 @@ public:
        virtual RenderingBuffer*        FrontBuffer() const;
        virtual RenderingBuffer*        BackBuffer() const;
 
-       virtual void                            ResizeBy(int32, int32);
+       virtual void                            ResizeBy(int32 x, int32 y);
 
 protected:
 
diff --git a/src/servers/app/drawing/interface/local/CompositeWindow.cpp 
b/src/servers/app/drawing/interface/local/CompositeWindow.cpp
new file mode 100644
index 0000000..6b3f258
--- /dev/null
+++ b/src/servers/app/drawing/interface/local/CompositeWindow.cpp
@@ -0,0 +1,178 @@
+
+#include "CompositeWindow.h"
+
+
+CompositeWindow::CompositeWindow(BRect frame, const char* name,
+                       window_look look, window_feel feel, uint32 flags, 
uint32 wspaces,
+                       ::ServerWindow* window, CompositeHWInterface* 
hwInterface)
+       :Window(frame, name, look, feel, flags, wspaces, window,
+               hwInterface->CreateDrawingEngine(this)),
+       fGraphicsCard(hwInterface)
+       {}
+
+
+CompositeWindow::~CompositeWindow()
+{
+       delete fGraphicsCard;
+}
+
+
+void
+CompositeWindow::BeginUpdate(BPrivate::PortLink& link)
+{
+       // Lock window buffer
+       Window::BeginUpdate(link);
+}
+
+
+void
+CompositeWindow::EndUpdate()
+{
+       Window::EndUpdate();
+       // unlock window buffer
+       // notify composite engine
+}
+
+
+bool
+CompositeWindow::ReloadDecor()
+{
+       // lock window buffer
+       // prepare for resize?
+       Window::ReloadDecor();
+       // unlock window buffer
+}
+
+
+void
+CompositeWindow::GetEffectiveDrawingRegion(View* view,
+                                                                       
BRegion& region)
+{
+       Window::GetEffectiveDrawingRegion(view, region);
+
+       if (!IsCompositeWindow())
+               return;
+
+       region.OffsetBy(-Frame().LeftTop());
+}
+
+
+void
+CompositeWindow::ProcessDirtyRegion(BRegion& regionOnScreen)
+{
+       if (!IsCompositeWindow()){
+               Window::ProcessDirtyRegion(regionOnScreen);
+               return;
+       }
+
+       //TODO:  will we need to continue with this?
+//     if (fDirtyRegion.CountRects() == 0)
+//             ServerWindow()->RequestRedraw();
+
+       // two-step process:
+       // we split out visible dirty areas from hidden dirty areas
+       // This case is required for the case an alpha-mode always-on-top
+       // window which truncates the visible region "improperly."
+       BRegion visible = VisibleRegion();
+       visible.IntersectWith(&regionOnScreen);
+
+       if (visible.CountRects() > 0)
+               gCompositeEngine->AddDirty(visible, true);
+
+       gCompositeEngine->AddDirty(region, false);
+}
+
+
+void
+CompositeWindow::RedrawDirtyRegion()
+{
+       Window::
+}
+
+
+void
+CompositeWindow::Activated(bool)
+{
+       Window::
+}
+
+
+void
+CompositeWindow::SetHidden(bool)
+{
+       Window::
+}
+
+
+void
+CompositeWindow::SetMinimized(bool)
+{
+       Window::
+}
+
+
+void
+CompositeWindow::ResizeBy(int32 x, int32 y, BRegion* dirtyRegion,
+                                                bool resizeStack)
+{
+       Window::
+}
+
+
+void
+CompositeWindow::SetFlags(uint32 flags, BRegion* updateRegion)
+{
+       Window::
+}
+
+
+void
+CompositeWindow::CompositingEnabled(bool)
+{
+       Window::
+}
+
+
+void
+CompositeWindow::CompositingEnabling()
+{
+       Window::
+}
+
+
+void
+CompositeWindow::CompositingDisabling()
+{
+       Window::
+}
+
+
+
+void
+CompositeWindow::ConvertForDrawing(BPoint* point) const
+{
+       Window::
+}
+
+
+void
+CompositeWindow::ConvertForDrawing(BRect* rect) const
+{
+       Window::
+}
+
+
+void
+CompositeWindow::ConvertForDrawing(BRegion* region) const
+{
+       Window::
+}
+
+
+void
+CompositeWindow::ConvertForDrawing(IntRect* rect) const
+{
+       Window::
+}
+
+


Other related posts:

  • » [haiku-commits] BRANCH looncraz-github.CAP-dirty [69aac4bcdc55] in src/servers/app/drawing/interface/local: . src/servers/app - looncraz-github . CAP-dirty