XE3

2,656 views
Skip to first unread message

Wayfer

unread,
Sep 14, 2012, 1:27:43 AM9/14/12
to delphichrom...@googlegroups.com
Hi.
Will you make delphichromiumembedded for XE3?
Thanks.

Anderson Dapper

unread,
Sep 14, 2012, 11:07:40 AM9/14/12
to delphichrom...@googlegroups.com
Try to use a XE2 version... In my test works fine in XE3.

Att,
Anderson Dapper Rocha



2012/9/14 Wayfer <way...@bk.ru>

Wayfer

unread,
Sep 14, 2012, 2:10:35 PM9/14/12
to delphichrom...@googlegroups.com
XE3, 17.0.4625.53395
ceffmx.pas, Errors: Bitmap has not ScanLine, undeclared 'StartLine', 'Platform', 'GetMousePos'.

пятница, 14 сентября 2012 г., 19:07:41 UTC+4 пользователь Anderson Dapper Rocha написал:

Александр Попов

unread,
Sep 14, 2012, 2:45:41 PM9/14/12
to delphichrom...@googlegroups.com
Firemonkey, Delphi, DCEF r147 ( https://code.google.com/p/delphichromiumembedded/source/browse/#svn%2Ftrunk )


пятница, 14 сентября 2012 г., 19:07:41 UTC+4 пользователь Anderson Dapper Rocha написал:
Try to use a XE2 version... In my test works fine in XE3.

Michael Brooks

unread,
Sep 16, 2012, 4:29:32 AM9/16/12
to delphichrom...@googlegroups.com
Hello  Александр

I had the same problem compiling in XE3.   It turns out XE3 removed the ScanLine property from the TBitmap in FMX.  Something like the following has to be used instead (at least until a change for XE3 is rolled into the DCEF core): 

var
  Rec: TBitmapData;
begin
  //...
  Bitmap.Map(TMapAccess.maRead, Rec);
  try
    //work with Rec.Data
  finally
    Bitmap.Unmap(Rec);
  end;
  //...
end;

Michael

Александр Попов

unread,
Sep 19, 2012, 1:10:03 AM9/19/12
to delphichrom...@googlegroups.com
It's not help for me.

воскресенье, 16 сентября 2012 г., 12:29:32 UTC+4 пользователь Michael Brooks написал:

Александр Попов

unread,
Sep 19, 2012, 1:11:35 AM9/19/12
to delphichrom...@googlegroups.com
May be DCEF3 will be for Firemonkey? No?

пятница, 14 сентября 2012 г., 9:27:43 UTC+4 пользователь Александр Попов написал:

Henri Gourvest

unread,
Sep 19, 2012, 5:38:06 AM9/19/12
to delphichrom...@googlegroups.com

as explained in a previous thread:

> Current version of CEF3 do not have offscreen rendering, so I can't create Firemonkey compatible component. 

Le mercredi 19 septembre 2012 11:31:45 UTC+2, snake a écrit :
+1. Will DCEF3 be avaible for FM? When?

Середа, 19 вересня 2012 р. 08:11:35 UTC+3 користувач Александр Попов написав:

Michael Brooks

unread,
Sep 19, 2012, 9:27:23 AM9/19/12
to delphichrom...@googlegroups.com
Hello  Александр 


On Tuesday, September 18, 2012 11:10:03 PM UTC-6, Александр Попов wrote:
It's not help for me.

Sorry, you're right I was not very helpful.   I didn't have any time to investigate it for myself beyond finding out that Scanline was removed from FMX.  

If you just need it to compile and install for VCL then you can remove (or comment out) the references to the FMX issues that come up when you compile the XE2 package.  In particular, the DCEF_XE2.dpk file (which you can find by using "project -> view source" when you try to compile the package) needs to be modify something like this:

requires
  rtl,
// Commented out fmx as temporary fix for compiling in XE3
//  vcl,
//  fmx;
  vcl;

contains
// Commented out ceffmx as temporary fix for compiling in XE3
//  ceffmx in '..\src\ceffmx.pas',
  cefvcl in '..\src\cefvcl.pas',
  ceflib in '..\src\ceflib.pas',
  cefgui in '..\src\cefgui.pas',
  cefreg in 'cefreg.pas';

and the cefvcl.pas file (which won't compile otherwise) need to have two "uses" clauses modified something like this:

uses
  Windows, Messages, Classes,
  cefgui, ceflib,
// Commented out Fmx Controls, Graphics as temporary fix for compiling in XE3
//{$ifdef DELPHI16_UP}
//  Vcl.Controls, Vcl.Graphics
//{$else}
//  Controls, Graphics
//{$endif};
  Vcl.Controls, Vcl.Graphics;

uses
// Commented out Fmx AppEvnts as temporary fix for compiling in XE3
//{$IFDEF DELPHI16_UP}
//  Vcl.AppEvnts;
//{$ELSE}
//  AppEvnts;
//{$ENDIF}
  Vcl.AppEvnts;

I'm unsure why the FMX stuff was referenced in the VCL files in the first place... it may have been overlooked by Henri (who BTW should be thanked for the fantastic job he's doing, THANK HENRI).  Hopefully Henri can implement a more elegant solution in the future for omitting the FMX stuff from the XE3 version.

Sorry, I can't help you (or myself) if you need FMX because of the issue Henri mentioned with offscreen CEF rendering.

Hope that helps.

Michael   

Александр Попов

unread,
Sep 19, 2012, 2:30:48 PM9/19/12
to delphichrom...@googlegroups.com
Ok, can i hope, that cef1 (cef2 i did not see) will be for Firemonkey XE3?

среда, 19 сентября 2012 г., 13:38:06 UTC+4 пользователь Henri Gourvest написал:

Александр Попов

unread,
Sep 19, 2012, 2:32:42 PM9/19/12
to delphichrom...@googlegroups.com
Thanks for VCL-version, but for VCL i can use DCEF3. But i want to use DCEF for Firemonkey XE3.

среда, 19 сентября 2012 г., 17:27:24 UTC+4 пользователь Michael Brooks написал:

Henri Gourvest

unread,
Sep 19, 2012, 5:56:23 PM9/19/12
to delphichrom...@googlegroups.com

Le 19 sept. 2012 à 20:32, Александр Попов a écrit :

Thanks for VCL-version, but for VCL i can use DCEF3. But i want to use DCEF for Firemonkey XE3.

Actually I have no time to spend on XE3 and DCEF1
You could try yourself to make it working and submit a patch.

--
Henri Gourvest

snake

unread,
Oct 5, 2012, 8:12:28 AM10/5/12
to delphichrom...@googlegroups.com
Ok, fixed DCEF1 to make it copilable under XE3. CefGetBitmap works properly. Visual component doesn't work. Can't understand why, but it doesn't keep its shape and it complain that there are no width and height properties. It's odd, becauses it's descendant of TControl.

Четвер, 20 вересня 2012 р. 00:56:29 UTC+3 користувач Henri Gourvest написав:
DCEF20121005_XE3.7Z

Cesar Liws

unread,
Oct 5, 2012, 8:18:51 AM10/5/12
to delphichrom...@googlegroups.com
Did you declare the height and width properties as published?




Cesar Romero



2012/10/5 snake <max.ne...@gmail.com>

snake

unread,
Oct 8, 2012, 7:57:48 AM10/8/12
to delphichrom...@googlegroups.com
Indeed, added these two properties into published and everything get working. But I wonder why it worked in XE2, but do not work in XE3? Anyway here is fixed version.


Пʼятниця, 5 жовтня 2012 р. 15:18:53 UTC+3 користувач Cesar Romero написав:
DCEF_20121008.7z

snake

unread,
Oct 9, 2012, 10:22:13 AM10/9/12
to delphichrom...@googlegroups.com
Yes, have same issue as well. Fixed it. Made it in very straightforward way. So maybe some performance reduction could be observed. 
Maybe Henri Gourvest could help us :) 

The issue in TCustomChromiumFMX.doOnPaint (ceffmx.pas). I converted this code as following:
    for c := 0 to dirtyRectsCount - 1 do
    begin
      w := Width * 4;
      offset := ((dirtyRects[c].y * Width) + dirtyRects[c].x) * 4;
      src := @PByte(buffer)[offset];
      {$IFDEF VER240}
      //FBUffer.Clear(claBlack);
      FBuffer.Map(TMapAccess.maWrite, rec);
      try
      {$ELSE}
      dst := @PByte(StartLine)[offset];
      {$ENDIF}
      offset := dirtyRects[c].width * 4;
      for i := 0 to dirtyRects[c].height - 1 do
      begin
//        for j := 0 to offset div 4 do
//          PAlphaColorArray(dst)[j] := PAlphaColorArray(src)[j] or $FF000000;
        {$IFDEF VER240}
        for j := 0 to dirtyRects[c].width - 1 do
        begin
          System.Move(src^, color, 4);
          rec.SetPixel({dirtyRects[c].x+}j, {dirtyRects[c].y+}i, color);
          Inc(src, 4);
        end;
        {$ELSE}
        System.Move(src^, dst^, offset);
        Inc(dst, w);
        Inc(src, w);
        {$ENDIF}
      end;

      {$IFDEF VER240}
      finally
        FBuffer.Unmap(rec);
      end;
      {$ENDIF}
      //InvalidateRect(ClipRect);
      InvalidateRect(RectF(dirtyRects[c].x, dirtyRects[c].y,
        dirtyRects[c].x + dirtyRects[c].width,  dirtyRects[c].y + dirtyRects[c].height));
    end;  

But turned out it doesn't always work. So I replaced it by:
  src := @PByte(buffer)[0];
      FBuffer.Map(TMapAccess.maWrite, rec);
      try
        for I := 0 to vh -1 do
          for J := 0 to vw - 1 do
          begin
            System.Move(src^, color, 4);
             rec.SetPixel(j, i, color);
             Inc(src, 4);

          end;

      finally
        FBuffer.Unmap(rec);
      end;
    end;
    InvalidateRect(ClipRect);
 
And it seems work. 

Вівторок, 9 жовтня 2012 р. 16:04:40 UTC+3 користувач Theodosis Kontaxis написав:
Hi snake i tried your fixed version for fmx XE3, i added TChromiumFMX into my form, compiled, then when everything seemed to be ok the webpage doesnt get rendered properly. I have attatched a screenshot with the problem.

It seems like any kind of graphics loading bugs the rendering of the page. If you resize it looks ok till you try and do something then the rendering distortion pops up.

I would like to know if you have similar issues or im doing something wrong?

Thanks for your time
DCEF_20121009.7z

Александр Попов

unread,
Oct 9, 2012, 12:35:36 PM10/9/12
to delphichrom...@googlegroups.com
Thanks, it's really work!

вторник, 9 октября 2012 г., 18:22:14 UTC+4 пользователь snake написал:

Theodosis Kontaxis

unread,
Oct 9, 2012, 3:21:57 PM10/9/12
to delphichrom...@googlegroups.com
Confirmed working on delphi XE3 fmx form, thanks for the fix snake.

And indeed i can notice some performance reduction compared to vcl but this will do for now :)
Message has been deleted

Michael Brooks

unread,
Oct 21, 2012, 10:41:20 PM10/21/12
to delphichrom...@googlegroups.com
Hello Snake:

Thanks for posting the fix.  Regarding this part of your fix:

  src := @PByte(buffer)[0];
      FBuffer.Map(TMapAccess.maWrite, rec);
      try
        for I := 0 to vh -1 do
          for J := 0 to vw - 1 do
          begin
            System.Move(src^, color, 4);
             rec.SetPixel(j, i, color);
             Inc(src, 4);
          end;
      finally
        FBuffer.Unmap(rec);
      end;
    end;
    InvalidateRect(ClipRect);
 
I haven't tried installing your modification yet but wanted to suggest you might be able to improve performance by 5 or more times if you use rec.Data instead of rec.SetPixel with code similar to this:

  FBuffer.Map(TMapAccess.maReadWrite, rec);
  try
    src := @PByte(buffer)[0];
    dst := rec.Data;
    repeat
        System.Move(src^, dst^, 4);
        Cardinal(src) := Cardinal(src) + 4;
        Cardinal(dst) := Cardinal(dst) + 4;
    until Cardinal(dst) - Cardinal(rec.Data) >
          (FBuffer.Width * FBuffer.Height * 4);
  finally
    FBuffer.Unmap(rec);
  end;
end;
InvalidateRect(ClipRect);

The code above assumes that both src and dst bitmaps are the same format, contiguous and that the variables of type:

  rec: TBitmapData;
  src, dst: Pointer;

I used code like this on another project to modify a bitmap.  When I was benchmarking my code I found that rec.GetPixel and rec.SetPixel took 0.522 seconds while using rec.Data for both took 0.046 seconds.

Michael

evos...@gmail.com

unread,
Jan 6, 2013, 3:27:14 PM1/6/13
to delphichrom...@googlegroups.com
On Tuesday, October 9, 2012 3:21:57 PM UTC-4, Theodosis Kontaxis wrote:
Confirmed working on delphi XE3 fmx form, thanks for the fix snake.

And indeed i can notice some performance reduction compared to vcl but this will do for now :)

When I try this code on Delphi XE3 it compiles fine in Windows.  When I try to compile with FireMonkey for OS X I get the following errors:

[dccosx Error] ceflib.pas(5657): E2003 Undeclared identifier: 'day_of_week'
[dccosx Error] ceflib.pas(7762): E2003 Undeclared identifier: 'CefAutoDetectProxySettings'
[dccosx Error] ceflib.pas(7763): E2010 Incompatible types: 'Boolean' and 'ustring'
[dccosx Fatal Error] main.pas(7): F2063 Could not compile used unit 'ceflib.pas'
Failed 

Any ideas?

Игорь

unread,
Jul 31, 2013, 10:38:14 AM7/31/13
to delphichrom...@googlegroups.com
problem with the portrayal and performance.

There is a ready ceffmx.pas?

or 

DCEF.7z ?



понедельник, 22 октября 2012 г., 9:41:20 UTC+7 пользователь Michael Brooks написал:

Игорь

unread,
Aug 1, 2013, 8:02:09 PM8/1/13
to delphichrom...@googlegroups.com
procedure TCustomChromiumFMX.doOnPaint(
const browser: ICefBrowser;
kind: TCefPaintElementType;
dirtyRectsCount: Cardinal;
const dirtyRects: PCefRectArray;
const buffer: Pointer
);
var
src, dst: Pointer;
vw, vh: Integer;
rec: TBitmapData;
begin

FBrowser.GetSize(PET_VIEW, vw, vh);
if FBuffer = nil then
FBuffer := TBitmap.Create(vw, vh);
with FBuffer do
if (vw = Width) and (vh = Height) then
begin


FBuffer.Map(TMapAccess.maReadWrite, rec);
try
src := @PByte(buffer)[0];
dst := rec.Data;
repeat
System.Move(src^, dst^, 4);
Cardinal(src) := Cardinal(src) + 4;
Cardinal(dst) := Cardinal(dst) + 4;
until Cardinal(dst) - Cardinal(rec.Data) >
(FBuffer.Width * FBuffer.Height * 4);
finally
FBuffer.Unmap(rec);
end;
end;
InvalidateRect(ClipRect);

end;


Игорь

unread,
Aug 2, 2013, 5:15:59 AM8/2/13
to delphichrom...@googlegroups.com

Loris Luise

unread,
Aug 4, 2013, 11:13:16 AM8/4/13
to delphichrom...@googlegroups.com
Yes, patched latest SVN repository and now compiling and working also on XE4.

Can these mods be merged?

Theodosios Kontaxis - HES

unread,
Aug 4, 2013, 2:09:24 PM8/4/13
to delphichrom...@googlegroups.com
Also made it work under XE4 but theres a serious rendering issue as Игорь posted. Anyone has a  fix for this?


2013/8/4 Loris Luise <loris...@stonebit.it>
--
You received this message because you are subscribed to the Google Groups "delphichromiumembedded" group.
To unsubscribe from this group and stop receiving emails from it, send an email to delphichromiumemb...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
              Hellenic Enterprise Solutions
                      http://www.hes.gr
Reply all
Reply to author
Forward
0 new messages