CEF 1 compilation fix. · enterstudio/cefpython@bea0974 · GitHub
Skip to content

Commit bea0974

Browse files
committed
CEF 1 compilation fix.
CEF 1 dummy api script updated. Off-screen rendering error fixed when rendering a popup.
1 parent e121f7d commit bea0974

5 files changed

Lines changed: 20 additions & 8 deletions

File tree

cefpython/browser.pyx

Lines changed: 3 additions & 3 deletions

cefpython/cef1/windows/binaries/cefpython_py27.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ def QuitMessageLoop():
4141
def Shutdown():
4242
return None
4343

44+
def GetModuleDirectory():
45+
return ""
46+
4447
#
4548
# Settings
4649
#
@@ -805,7 +808,7 @@ def RenderHandler_OnPopupShow(browser, show):
805808
def RenderHandler_OnPopupSize(browser, rect):
806809
return None
807810

808-
def RenderHandler_OnPaint(browser, paintElementType, out_dirtyRects,
811+
def RenderHandler_OnPaint(browser, paintElementType, out_dirtyRects,
809812
paintBuffer):
810813
return None
811814

cefpython/cef1/windows/binaries/panda3d_.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# CEF off-screen rendering using the Panda3D game engine:
22
# http://www.panda3d.org/
33

4-
# You need panda3D runtime that is compatible with python 2.7,
4+
# You need panda3D SDK that is compatible with python 2.7,
55
# version 1.8.0 comes by default with python 2.7.
66

77
# To use custom python (not the one provided with the SDK)
@@ -327,7 +327,12 @@ def __init__(self, browser, texture):
327327
def OnPaint(self, browser, paintElementType, dirtyRects, buffer):
328328
(width, height) = self.browser.GetSize(paintElementType)
329329
img = self.texture.modifyRamImage()
330-
img.setData(buffer.GetString(mode="bgra", origin="bottom-left"))
330+
if paintElementType == cefpython.PET_POPUP:
331+
print("width=%s, height=%s" % (width, height))
332+
elif paintElementType == cefpython.PET_VIEW:
333+
img.setData(buffer.GetString(mode="bgra", origin="bottom-left"))
334+
else:
335+
raise Exception("Unknown paintElementType: %s" % paintElementType)
331336

332337
def GetViewRect(self, browser, rect):
333338
return False

cefpython/cef1_api.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ def QuitMessageLoop():
4141
def Shutdown():
4242
return None
4343

44+
def GetModuleDirectory():
45+
return ""
46+
4447
#
4548
# Settings
4649
#
@@ -805,7 +808,7 @@ def RenderHandler_OnPopupShow(browser, show):
805808
def RenderHandler_OnPopupSize(browser, rect):
806809
return None
807810

808-
def RenderHandler_OnPaint(browser, paintElementType, out_dirtyRects,
811+
def RenderHandler_OnPaint(browser, paintElementType, out_dirtyRects,
809812
paintBuffer):
810813
return None
811814

cefpython/cython_includes/cef_types_wrappers.pxd

Lines changed: 2 additions & 1 deletion

0 commit comments

Comments
 (0)