[-]
[+]
|
Changed |
qtwebkit.spec
|
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/.qmake.conf
^
|
@@ -3,4 +3,4 @@
QMAKEPATH += $$PWD/Tools/qmake $$MODULE_QMAKE_OUTDIR
load(qt_build_config)
-MODULE_VERSION = 5.3.2
+MODULE_VERSION = 5.4.1
|
[-]
[+]
|
Added |
qtwebkit-5.4.1.tar.xz/LICENSE.GPLv2
^
|
@@ -0,0 +1,292 @@
+ GNU GENERAL PUBLIC LICENSE
+
+ The Qt Toolkit is Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
+ Contact: http://www.qt-project.org/legal
+
+ You may use, distribute and copy the Qt GUI Toolkit under the terms of
+ GNU General Public License version 2, which is displayed below.
+
+-------------------------------------------------------------------------
+
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+
+Everyone is permitted to copy and distribute verbatim copies of this
+license document, but changing it is not allowed.
+
+Preamble
+
+ The licenses for most software are designed to take away your freedom
+to share and change it. By contrast, the GNU General Public License is
+intended to guarantee your freedom to share and change free software
+--to make sure the software is free for all its users. This General
+Public License applies to most of the Free Software Foundation's
+software and to any other program whose authors commit to using it.
+(Some other Free Software Foundation software is covered by the GNU
+Lesser General Public License instead.) You can apply it to your
+programs, too.
+
+When we speak of free software, we are referring to freedom, not price.
+Our General Public Licenses are designed to make sure that you have the
+freedom to distribute copies of free software (and charge for this
+service if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs; and that you know you can do these things.
+
+To protect your rights, we need to make restrictions that forbid anyone
+to deny you these rights or to ask you to surrender the rights. These
+restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+For example, if you distribute copies of such a program, whether gratis
+ or for a fee, you must give the recipients all the rights that you
+have. You must make sure that they, too, receive or can get the source
+code. And you must show them these terms so they know their rights.
+
+We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+Finally, any free program is threatened constantly by software patents.
+We wish to avoid the danger that redistributors of a free program will
+individually obtain patent licenses, in effect making the program
+proprietary. To prevent this, we have made it clear that any patent
+must be licensed for everyone's free use or not licensed at all.
+
+The precise terms and conditions for copying, distribution and
+modification follow.
+
+TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+0. This License applies to any program or other work which contains a
+notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of running
+the Program is not restricted, and the output from the Program is
+covered only if its contents constitute a work based on the Program
+(independent of having been made by running the Program). Whether that
+is true depends on what the Program does.
+
+1. You may copy and distribute verbatim copies of the Program's source
+code as you receive it, in any medium, provided that you conspicuously
+and appropriately publish on each copy an appropriate copyright notice
+and disclaimer of warranty; keep intact all the notices that refer to
+this License and to the absence of any warranty; and give any other
+recipients of the Program a copy of this License along with the
+Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+2. You may modify your copy or copies of the Program or any portion of
+it, thus forming a work based on the Program, and copy and distribute
+such modifications or work under the terms of Section 1 above, provided
+that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but does
+ not normally print such an announcement, your work based on the
+ Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of a
+storage or distribution medium does not bring the other work under the
+scope of this License.
+
+3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software
+ interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your cost
+ of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to control
+compilation and installation of the executable. However, as a special
+exception, the source code distributed need not include anything that
+is normally distributed (in either source or binary form) with the
+major components (compiler, kernel, and so on) of the operating system
+on which the executable runs, unless that component itself accompanies
+the executable.
+
+If distribution of executable or object code is made by offering access
+to copy from a designated place, then offering equivalent access to
+copy the source code from the same place counts as distribution of the
+source code, even though third parties are not compelled to copy the
+source along with the object code.
+
+4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt otherwise
+to copy, modify, sublicense or distribute the Program is void, and will
+automatically terminate your rights under this License. However,
+parties who have received copies, or rights, from you under this License
+will not have their licenses terminated so long as such parties remain
+in full compliance.
+
+5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
|
[-]
[+]
|
Added |
qtwebkit-5.4.1.tar.xz/LICENSE.LGPLv21
^
|
@@ -0,0 +1,514 @@
+ GNU LESSER GENERAL PUBLIC LICENSE
+
+ The Qt Toolkit is Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
+ Contact: http://www.qt-project.org/legal
+
+ You may use, distribute and copy the Qt GUI Toolkit under the terms of
+ GNU Lesser General Public License version 2.1, which is displayed below.
+
+-------------------------------------------------------------------------
+
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL. It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+ This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it. You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+ When we speak of free software, we are referring to freedom of use,
+not price. Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+ To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights. These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+ For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you. You must make sure that they, too, receive or can get the source
+code. If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it. And you must show them these terms so they know their rights.
+
+ We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+ To protect each distributor, we want to make it very clear that
+there is no warranty for the free library. Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+ Finally, software patents pose a constant threat to the existence of
+any free program. We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder. Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+ Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License. This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License. We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+ When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library. The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom. The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+ We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License. It also provides other free software developers Less
+of an advantage over competing non-free programs. These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries. However, the Lesser license provides advantages in certain
+special circumstances.
+
+ For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard. To achieve this, non-free programs must be
+allowed to use the library. A more frequent case is that a free
+library does the same job as widely used non-free libraries. In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+ In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software. For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+ Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+ The precise terms and conditions for copying, distribution and
+modification follow. Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library". The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+ GNU LESSER GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+ A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+ The "Library", below, refers to any such software library or work
+which has been distributed under these terms. A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language. (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+ "Source code" for a work means the preferred form of the work for
+making modifications to it. For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+ Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it). Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+ 1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+ You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+ 2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) The modified work must itself be a software library.
+
+ b) You must cause the files modified to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ c) You must cause the whole of the work to be licensed at no
+ charge to all third parties under the terms of this License.
+
+ d) If a facility in the modified Library refers to a function or a
+ table of data to be supplied by an application program that uses
+ the facility, other than as an argument passed when the facility
+ is invoked, then you must make a good faith effort to ensure that,
+ in the event an application does not supply such function or
+ table, the facility still operates, and performs whatever part of
+ its purpose remains meaningful.
+
+ (For example, a function in a library to compute square roots has
+ a purpose that is entirely well-defined independent of the
+ application. Therefore, Subsection 2d requires that any
+ application-supplied function or table used by this function must
+ be optional: if the application does not supply it, the square
+ root function must still compute square roots.)
+
|
[-]
[+]
|
Added |
qtwebkit-5.4.1.tar.xz/LICENSE.LGPLv3
^
|
@@ -0,0 +1,173 @@
+ GNU LESSER GENERAL PUBLIC LICENSE
+
+ The Qt Toolkit is Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
+ Contact: http://www.qt-project.org/legal
+
+ You may use, distribute and copy the Qt GUI Toolkit under the terms of
+ GNU Lesser General Public License version 3, which is displayed below.
+
+-------------------------------------------------------------------------
+
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright © 2007 Free Software Foundation, Inc. <http://fsf.org/>
+Everyone is permitted to copy and distribute verbatim copies of this
+licensedocument, but changing it is not allowed.
+
+This version of the GNU Lesser General Public License incorporates
+the terms and conditions of version 3 of the GNU General Public
+License, supplemented by the additional permissions listed below.
+
+0. Additional Definitions.
+
+ As used herein, “this License” refers to version 3 of the GNU Lesser
+General Public License, and the “GNU GPL” refers to version 3 of the
+GNU General Public License.
+
+ “The Library” refers to a covered work governed by this License,
+other than an Application or a Combined Work as defined below.
+
+ An “Application” is any work that makes use of an interface provided
+by the Library, but which is not otherwise based on the Library.
+Defining a subclass of a class defined by the Library is deemed a mode
+of using an interface provided by the Library.
+
+ A “Combined Work” is a work produced by combining or linking an
+Application with the Library. The particular version of the Library
+with which the Combined Work was made is also called the “Linked
+Version”.
+
+ The “Minimal Corresponding Source” for a Combined Work means the
+Corresponding Source for the Combined Work, excluding any source code
+for portions of the Combined Work that, considered in isolation, are
+based on the Application, and not on the Linked Version.
+
+ The “Corresponding Application Code” for a Combined Work means the
+object code and/or source code for the Application, including any data
+and utility programs needed for reproducing the Combined Work from the
+Application, but excluding the System Libraries of the Combined Work.
+
+1. Exception to Section 3 of the GNU GPL.
+
+ You may convey a covered work under sections 3 and 4 of this License
+without being bound by section 3 of the GNU GPL.
+
+2. Conveying Modified Versions.
+
+ If you modify a copy of the Library, and, in your modifications, a
+facility refers to a function or data to be supplied by an Application
+that uses the facility (other than as an argument passed when the
+facility is invoked), then you may convey a copy of the modified
+version:
+
+ a) under this License, provided that you make a good faith effort
+ to ensure that, in the event an Application does not supply the
+ function or data, the facility still operates, and performs
+ whatever part of its purpose remains meaningful, or
+
+ b) under the GNU GPL, with none of the additional permissions of
+ this License applicable to that copy.
+
+3. Object Code Incorporating Material from Library Header Files.
+
+ The object code form of an Application may incorporate material from
+a header file that is part of the Library. You may convey such object
+code under terms of your choice, provided that, if the incorporated
+material is not limited to numerical parameters, data structure
+layouts and accessors, or small macros, inline functions and templates
+(ten or fewer lines in length), you do both of the following:
+
+ a) Give prominent notice with each copy of the object code that
+ the Library is used in it and that the Library and its use are
+ covered by this License.
+
+ b) Accompany the object code with a copy of the GNU GPL and this
+ license document.
+
+4. Combined Works.
+
+ You may convey a Combined Work under terms of your choice that, taken
+together, effectively do not restrict modification of the portions of
+the Library contained in the Combined Work and reverse engineering for
+debugging such modifications, if you also do each of the following:
+
+ a) Give prominent notice with each copy of the Combined Work that
+ the Library is used in it and that the Library and its use are
+ covered by this License.
+
+ b) Accompany the Combined Work with a copy of the GNU GPL and this
+ license document.
+
+ c) For a Combined Work that displays copyright notices during
+ execution, include the copyright notice for the Library among
+ these notices, as well as a reference directing the user to the
+ copies of the GNU GPL and this license document.
+
+ d) Do one of the following:
+
+ 0) Convey the Minimal Corresponding Source under the terms of
+ this License, and the Corresponding Application Code in a form
+ suitable for, and under terms that permit, the user to
+ recombine or relink the Application with a modified version of
+ the Linked Version to produce a modified Combined Work, in the
+ manner specified by section 6 of the GNU GPL for conveying
+ Corresponding Source.
+
+ 1) Use a suitable shared library mechanism for linking with
+ the Library. A suitable mechanism is one that (a) uses at run
+ time a copy of the Library already present on the user's
+ computer system, and (b) will operate properly with a modified
+ version of the Library that is interface-compatible with the
+ Linked Version.
+
+ e) Provide Installation Information, but only if you would
+ otherwise be required to provide such information under section 6
+ of the GNU GPL, and only to the extent that such information is
+ necessary to install and execute a modified version of the
+ Combined Work produced by recombining or relinking the Application
+ with a modified version of the Linked Version. (If you use option
+ 4d0, the Installation Information must accompany the Minimal
+ Corresponding Source and Corresponding Application Code. If you
+ use option 4d1, you must provide the Installation Information in
+ the manner specified by section 6 of the GNU GPL for conveying
+ Corresponding Source.)
+
+5. Combined Libraries.
+
+ You may place library facilities that are a work based on the Library
+side by side in a single library together with other library
+facilities that are not Applications and are not covered by this
+License, and convey such a combined library under terms of your
+choice, if you do both of the following:
+
+ a) Accompany the combined library with a copy of the same work
+ based on the Library, uncombined with any other library
+ facilities, conveyed under the terms of this License.
+
+ b) Give prominent notice with the combined library that part of
+ it is a work based on the Library, and explaining where to find
+ the accompanying uncombined form of the same work.
+
+6. Revised Versions of the GNU Lesser General Public License.
+
+ The Free Software Foundation may publish revised and/or new versions
+of the GNU Lesser General Public License from time to time. Such new
+versions will be similar in spirit to the present version, but may
+differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Library
+as you received it specifies that a certain numbered version of the
+GNU Lesser General Public License “or any later version” applies to
+it, you have the option of following the terms and conditions either
+of that published version or of any later version published by the
+Free Software Foundation. If the Library as you received it does not
+specify a version number of the GNU Lesser General Public License,
+you may choose any version of the GNU Lesser General Public License
+ever published by the Free Software Foundation.
+
+If the Library as you received it specifies that a proxy can decide
+whether future versions of the GNU Lesser General Public License shall
+apply, that proxy's public statement of acceptance of any version is
+permanent authorization for you to choose that version for the Library.
+
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/JavaScriptCore/assembler/AbstractMacroAssembler.h
^
|
@@ -54,6 +54,15 @@
#endif
}
+inline bool isMIPS()
+{
+#if CPU(MIPS)
+ return true;
+#else
+ return false;
+#endif
+}
+
inline bool isX86()
{
#if CPU(X86_64) || CPU(X86)
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/JavaScriptCore/assembler/MIPSAssembler.h
^
|
@@ -730,35 +730,6 @@
// writable region of memory; to modify the code in an execute-only execuable
// pool the 'repatch' and 'relink' methods should be used.
- static size_t linkDirectJump(void* code, void* to)
- {
- MIPSWord* insn = reinterpret_cast<MIPSWord*>(reinterpret_cast<intptr_t>(code));
- size_t ops = 0;
- int32_t slotAddr = reinterpret_cast<int>(insn) + 4;
- int32_t toAddr = reinterpret_cast<int>(to);
-
- if ((slotAddr & 0xf0000000) != (toAddr & 0xf0000000)) {
- // lui
- *insn = 0x3c000000 | (MIPSRegisters::t9 << OP_SH_RT) | ((toAddr >> 16) & 0xffff);
- ++insn;
- // ori
- *insn = 0x34000000 | (MIPSRegisters::t9 << OP_SH_RT) | (MIPSRegisters::t9 << OP_SH_RS) | (toAddr & 0xffff);
- ++insn;
- // jr
- *insn = 0x00000008 | (MIPSRegisters::t9 << OP_SH_RS);
- ++insn;
- ops = 4 * sizeof(MIPSWord);
- } else {
- // j
- *insn = 0x08000000 | ((toAddr & 0x0fffffff) >> 2);
- ++insn;
- ops = 2 * sizeof(MIPSWord);
- }
- // nop
- *insn = 0x00000000;
- return ops;
- }
-
void linkJump(AssemblerLabel from, AssemblerLabel to)
{
ASSERT(to.isSet());
@@ -898,34 +869,42 @@
static ptrdiff_t maxJumpReplacementSize()
{
- return sizeof(MIPSWord) * 4;
+ return sizeof(MIPSWord) * 2;
}
static void revertJumpToMove(void* instructionStart, RegisterID rt, int imm)
{
MIPSWord* insn = static_cast<MIPSWord*>(instructionStart);
- size_t codeSize = 2 * sizeof(MIPSWord);
// lui
*insn = 0x3c000000 | (rt << OP_SH_RT) | ((imm >> 16) & 0xffff);
++insn;
// ori
*insn = 0x34000000 | (rt << OP_SH_RS) | (rt << OP_SH_RT) | (imm & 0xffff);
- ++insn;
- // if jr $t9
- if (*insn == 0x03200008) {
- *insn = 0x00000000;
- codeSize += sizeof(MIPSWord);
- }
- cacheFlush(insn, codeSize);
+ cacheFlush(insn, 2 * sizeof(MIPSWord));
+ }
+
+ static bool canJumpWithJ(void* instructionStart, void* to)
+ {
+ intptr_t slotAddr = reinterpret_cast<intptr_t>(instructionStart) + 4;
+ intptr_t toAddr = reinterpret_cast<intptr_t>(to);
+ return (slotAddr & 0xf0000000) == (toAddr & 0xf0000000);
}
static void replaceWithJump(void* instructionStart, void* to)
{
ASSERT(!(bitwise_cast<uintptr_t>(instructionStart) & 3));
ASSERT(!(bitwise_cast<uintptr_t>(to) & 3));
- size_t ops = linkDirectJump(instructionStart, to);
- cacheFlush(instructionStart, ops);
+ ASSERT(canJumpWithJ(instructionStart, to));
+ MIPSWord* insn = reinterpret_cast<MIPSWord*>(instructionStart);
+ int32_t toAddr = reinterpret_cast<int32_t>(to);
+
+ // j <to>
+ *insn = 0x08000000 | ((toAddr & 0x0fffffff) >> 2);
+ ++insn;
+ // nop
+ *insn = 0x00000000;
+ cacheFlush(instructionStart, 2 * sizeof(MIPSWord));
}
static void replaceWithLoad(void* instructionStart)
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/JavaScriptCore/assembler/MacroAssemblerARM.cpp
^
|
@@ -47,6 +47,10 @@
static bool isVFPPresent()
{
+#if defined(__SOFTFP__)
+ return false;
+#endif
+
#if OS(LINUX)
int fd = open("/proc/self/auxv", O_RDONLY);
if (fd > 0) {
@@ -70,7 +74,7 @@
const bool MacroAssemblerARM::s_isVFPPresent = isVFPPresent();
-#if CPU(ARMV5_OR_LOWER)
+#if !CPU(ARM_FEATURE_UNALIGNED)
/* On ARMv5 and below, natural alignment is required. */
void MacroAssemblerARM::load32WithUnalignedHalfWords(BaseIndex address, RegisterID dest)
{
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/JavaScriptCore/assembler/MacroAssemblerARM.h
^
|
@@ -393,7 +393,7 @@
m_assembler.baseIndexTransfer32(ARMAssembler::LoadUint32, dest, address.base, address.index, static_cast<int>(address.scale), address.offset);
}
-#if CPU(ARMV5_OR_LOWER)
+#if !CPU(ARM_FEATURE_UNALIGNED)
void load32WithUnalignedHalfWords(BaseIndex address, RegisterID dest);
#else
void load32WithUnalignedHalfWords(BaseIndex address, RegisterID dest)
@@ -725,6 +725,11 @@
return Jump(m_assembler.jmp(ARMCondition(cond)));
}
+ Jump branchAdd32(ResultCondition cond, Address src, RegisterID dest)
+ {
+ load32(src, ARMRegisters::S0);
+ return branchAdd32(cond, dest, ARMRegisters::S0, dest);
+ }
void mull32(RegisterID op1, RegisterID op2, RegisterID dest)
{
if (op2 == dest) {
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/JavaScriptCore/assembler/MacroAssemblerARMv7.h
^
|
@@ -1473,6 +1473,12 @@
return branchAdd32(cond, dest, src, dest);
}
+ Jump branchAdd32(ResultCondition cond, Address src, RegisterID dest)
+ {
+ load32(src, dataTempRegister);
+ return branchAdd32(cond, dest, dataTempRegister, dest);
+ }
+
Jump branchAdd32(ResultCondition cond, TrustedImm32 imm, RegisterID dest)
{
return branchAdd32(cond, dest, imm, dest);
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/JavaScriptCore/assembler/MacroAssemblerMIPS.h
^
|
@@ -768,7 +768,53 @@
void load16Unaligned(BaseIndex address, RegisterID dest)
{
- load16(address, dest);
+ if (address.offset >= -32768 && address.offset <= 32766 && !m_fixedWidth) {
+ /*
+ sll addrtemp, address.index, address.scale
+ addu addrtemp, addrtemp, address.base
+ lbu immTemp, address.offset+x(addrtemp) (x=0 for LE, x=1 for BE)
+ lbu dest, address.offset+x(addrtemp) (x=1 for LE, x=0 for BE)
+ sll dest, dest, 8
+ or dest, dest, immTemp
+ */
+ m_assembler.sll(addrTempRegister, address.index, address.scale);
+ m_assembler.addu(addrTempRegister, addrTempRegister, address.base);
+#if CPU(BIG_ENDIAN)
+ m_assembler.lbu(immTempRegister, addrTempRegister, address.offset + 1);
+ m_assembler.lbu(dest, addrTempRegister, address.offset);
+#else
+ m_assembler.lbu(immTempRegister, addrTempRegister, address.offset);
+ m_assembler.lbu(dest, addrTempRegister, address.offset + 1);
+#endif
+ m_assembler.sll(dest, dest, 8);
+ m_assembler.orInsn(dest, dest, immTempRegister);
+ } else {
+ /*
+ sll addrTemp, address.index, address.scale
+ addu addrTemp, addrTemp, address.base
+ lui immTemp, address.offset >> 16
+ ori immTemp, immTemp, address.offset & 0xffff
+ addu addrTemp, addrTemp, immTemp
+ lbu immTemp, x(addrtemp) (x=0 for LE, x=1 for BE)
+ lbu dest, x(addrtemp) (x=1 for LE, x=0 for BE)
+ sll dest, dest, 8
+ or dest, dest, immTemp
+ */
+ m_assembler.sll(addrTempRegister, address.index, address.scale);
+ m_assembler.addu(addrTempRegister, addrTempRegister, address.base);
+ m_assembler.lui(immTempRegister, address.offset >> 16);
+ m_assembler.ori(immTempRegister, immTempRegister, address.offset);
+ m_assembler.addu(addrTempRegister, addrTempRegister, immTempRegister);
+#if CPU(BIG_ENDIAN)
+ m_assembler.lbu(immTempRegister, addrTempRegister, 1);
+ m_assembler.lbu(dest, addrTempRegister, 0);
+#else
+ m_assembler.lbu(immTempRegister, addrTempRegister, 0);
+ m_assembler.lbu(dest, addrTempRegister, 1);
+#endif
+ m_assembler.sll(dest, dest, 8);
+ m_assembler.orInsn(dest, dest, immTempRegister);
+ }
}
void load32WithUnalignedHalfWords(BaseIndex address, RegisterID dest)
@@ -1630,6 +1676,12 @@
return branchAdd32(cond, immTempRegister, dest);
}
+ Jump branchAdd32(ResultCondition cond, Address address, RegisterID dest)
+ {
+ load32(address, immTempRegister);
+ return branchAdd32(cond, immTempRegister, dest);
+ }
+
Jump branchAdd32(ResultCondition cond, RegisterID src, TrustedImm32 imm, RegisterID dest)
{
move(imm, immTempRegister);
@@ -2538,8 +2590,6 @@
Jump branchEqual(RegisterID rs, RegisterID rt)
{
- m_assembler.nop();
- m_assembler.nop();
m_assembler.appendJump();
m_assembler.beq(rs, rt, 0);
m_assembler.nop();
@@ -2549,8 +2599,6 @@
Jump branchNotEqual(RegisterID rs, RegisterID rt)
{
- m_assembler.nop();
- m_assembler.nop();
m_assembler.appendJump();
m_assembler.bne(rs, rt, 0);
m_assembler.nop();
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/JavaScriptCore/assembler/MacroAssemblerSH4.h
^
|
@@ -2080,6 +2080,29 @@
return result ? branchTrue() : branchFalse();
}
+ Jump branchAdd32(ResultCondition cond, Address src, RegisterID dest)
+ {
+ ASSERT((cond == Overflow) || (cond == Signed) || (cond == PositiveOrZero) || (cond == Zero) || (cond == NonZero));
+
+ if (cond == Overflow) {
+ RegisterID srcVal = claimScratch();
+ load32(src, srcVal);
+ m_assembler.addvlRegReg(srcVal, dest);
+ releaseScratch(srcVal);
+ return branchTrue();
+ }
+
+ add32(src, dest);
+
+ if ((cond == Signed) || (cond == PositiveOrZero)) {
+ m_assembler.cmppz(dest);
+ return (cond == Signed) ? branchFalse() : branchTrue();
+ }
+
+ compare32(0, dest, Equal);
+ return (cond == NonZero) ? branchFalse() : branchTrue();
+ }
+
Jump branchMul32(ResultCondition cond, RegisterID src, RegisterID dest)
{
ASSERT((cond == Overflow) || (cond == Signed) || (cond == Zero) || (cond == NonZero));
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/JavaScriptCore/dfg/DFGAbstractState.cpp
^
|
@@ -476,6 +476,7 @@
}
case MakeRope: {
+ node->setCanExit(true);
forNode(node).set(m_graph.m_vm.stringStructure.get());
break;
}
@@ -1255,7 +1256,7 @@
case GetScope: // FIXME: We could get rid of these if we know that the JSFunction is a constant. https://bugs.webkit.org/show_bug.cgi?id=106202
case GetMyScope:
case SkipTopScope:
- forNode(node).set(SpecCellOther);
+ forNode(node).set(SpecObjectOther);
break;
case SkipScope: {
@@ -1264,7 +1265,7 @@
m_foundConstants = true;
break;
}
- forNode(node).set(SpecCellOther);
+ forNode(node).set(SpecObjectOther);
break;
}
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/JavaScriptCore/dfg/DFGCCallHelpers.h
^
|
@@ -489,6 +489,12 @@
swap(GPRInfo::argumentGPR2, GPRInfo::argumentGPR3);
}
+#if CPU(MIPS)
+#define POKE_ARGUMENT_OFFSET 4
+#else
+#define POKE_ARGUMENT_OFFSET 0
+#endif
+
#if CPU(X86_64)
ALWAYS_INLINE void setupArguments(FPRReg arg1)
{
@@ -549,6 +555,21 @@
setupStubArguments(arg1, arg2);
move(GPRInfo::callFrameRegister, GPRInfo::argumentGPR0);
}
+
+ ALWAYS_INLINE void setupArgumentsWithExecState(TrustedImm32, FPRReg arg2, GPRReg arg3)
+ {
+ moveDouble(arg2, FPRInfo::argumentFPR0);
+ move(arg3, GPRInfo::argumentGPR1);
+ move(GPRInfo::callFrameRegister, GPRInfo::argumentGPR0);
+ }
+
+ ALWAYS_INLINE void setupArgumentsWithExecState(GPRReg arg1, GPRReg arg2, TrustedImm32, FPRReg arg4)
+ {
+ moveDouble(arg4, FPRInfo::argumentFPR0);
+ setupStubArguments(arg1, arg2);
+ move(GPRInfo::callFrameRegister, GPRInfo::argumentGPR0);
+ }
+
#else
ALWAYS_INLINE void setupArguments(FPRReg arg1)
{
@@ -575,6 +596,24 @@
assembler().vmov(GPRInfo::argumentGPR3, GPRInfo::nonArgGPR0, arg3);
poke(GPRInfo::nonArgGPR0);
}
+
+ ALWAYS_INLINE void setupArgumentsWithExecState(TrustedImm32 arg1, FPRReg arg2, GPRReg arg3)
+ {
+ poke(arg3, POKE_ARGUMENT_OFFSET);
+ move(arg1, GPRInfo::argumentGPR1);
+ assembler().vmov(GPRInfo::argumentGPR2, GPRInfo::argumentGPR3, arg2);
+ move(GPRInfo::callFrameRegister, GPRInfo::argumentGPR0);
+ }
+
+ ALWAYS_INLINE void setupArgumentsWithExecState(GPRReg arg1, GPRReg arg2, TrustedImm32 arg3, FPRReg arg4)
+ {
+ setupStubArguments(arg1, arg2);
+ move(GPRInfo::callFrameRegister, GPRInfo::argumentGPR0);
+ move(arg3, GPRInfo::argumentGPR3);
+ assembler().vmov(GPRInfo::nonArgGPR0, GPRInfo::nonArgGPR1, arg4);
+ poke(GPRInfo::nonArgGPR0, POKE_ARGUMENT_OFFSET);
+ poke(GPRInfo::nonArgGPR1, POKE_ARGUMENT_OFFSET + 1);
+ }
#endif // CPU(ARM_HARDFP)
#elif CPU(MIPS)
ALWAYS_INLINE void setupArguments(FPRReg arg1)
@@ -609,6 +648,16 @@
move(GPRInfo::callFrameRegister, GPRInfo::argumentGPR0);
poke(arg3, 4);
}
+
+ ALWAYS_INLINE void setupArgumentsWithExecState(TrustedImm32 arg1, FPRReg arg2, GPRReg arg3)
+ {
+ setupArgumentsWithExecState(arg2, arg3);
+ }
+
+ ALWAYS_INLINE void setupArgumentsWithExecState(GPRReg arg1, GPRReg arg2, TrustedImm32 arg3, FPRReg arg4)
+ {
+ setupArgumentsWithExecState(arg1, arg2, arg4);
+ }
#elif CPU(SH4)
ALWAYS_INLINE void setupArguments(FPRReg arg1)
{
@@ -868,12 +917,6 @@
// exactly 4 argument registers, e.g. ARMv7.
#if NUMBER_OF_ARGUMENT_REGISTERS == 4
-#if CPU(MIPS)
-#define POKE_ARGUMENT_OFFSET 4
-#else
-#define POKE_ARGUMENT_OFFSET 0
-#endif
-
ALWAYS_INLINE void setupArgumentsWithExecState(GPRReg arg1, GPRReg arg2, GPRReg arg3, GPRReg arg4)
{
poke(arg4, POKE_ARGUMENT_OFFSET);
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/JavaScriptCore/dfg/DFGCSEPhase.cpp
^
|
@@ -254,9 +254,11 @@
break;
}
case PutScopedVar: {
- if (node->child2() == registers && node->varNumber() == varNumber)
+ if (node->varNumber() != varNumber)
+ break;
+ if (node->child2() == registers)
return node->child3().node();
- break;
+ return 0;
}
case SetLocal: {
VariableAccessData* variableAccessData = node->variableAccessData();
@@ -327,9 +329,11 @@
Node* node = m_currentBlock->at(i);
switch (node->op()) {
case PutScopedVar: {
- if (node->child1() == scope && node->child2() == registers && node->varNumber() == varNumber)
+ if (node->varNumber() != varNumber)
+ break;
+ if (node->child1() == scope && node->child2() == registers)
return node;
- break;
+ return 0;
}
case GetScopedVar: {
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/JavaScriptCore/dfg/DFGFixupPhase.cpp
^
|
@@ -214,7 +214,7 @@
case ArithDiv: {
if (Node::shouldSpeculateIntegerForArithmetic(node->child1().node(), node->child2().node())
&& node->canSpeculateInteger()) {
- if (isX86() || isARMv7s()) {
+ if (isX86() || isARMv7s() || isMIPS()) {
setUseKindAndUnboxIfProfitable<Int32Use>(node->child1());
setUseKindAndUnboxIfProfitable<Int32Use>(node->child2());
break;
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/JavaScriptCore/dfg/DFGOperations.cpp
^
|
@@ -1644,6 +1644,11 @@
VM& vm = exec->vm();
NativeCallFrameTracer tracer(&vm, exec);
+ if (static_cast<int32_t>(left->length() + right->length()) < 0) {
+ throwOutOfMemoryError(exec);
+ return 0;
+ }
+
return JSRopeString::create(vm, left, right);
}
@@ -1652,6 +1657,14 @@
VM& vm = exec->vm();
NativeCallFrameTracer tracer(&vm, exec);
+ Checked<int32_t, RecordOverflow> length = a->length();
+ length += b->length();
+ length += c->length();
+ if (length.hasOverflowed()) {
+ throwOutOfMemoryError(exec);
+ return 0;
+ }
+
return JSRopeString::create(vm, a, b, c);
}
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp
^
|
@@ -396,7 +396,7 @@
case GetMyScope:
case SkipTopScope:
case SkipScope: {
- changed |= setPrediction(SpecCellOther);
+ changed |= setPrediction(SpecObjectOther);
break;
}
@@ -497,7 +497,7 @@
break;
case GetScope:
- changed |= setPrediction(SpecCellOther);
+ changed |= setPrediction(SpecObjectOther);
break;
case Identity:
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
^
|
@@ -3042,6 +3042,24 @@
}
integerResult(quotientThenRemainderGPR, node);
+#elif CPU(MIPS)
+ GPRTemporary remainder(this);
+ GPRReg dividendGPR = op1.gpr();
+ GPRReg divisorGPR = op2.gpr();
+ GPRReg remainderGPR = remainder.gpr();
+
+ speculationCheck(Overflow, JSValueRegs(), 0, m_jit.branch32(JITCompiler::Equal, dividendGPR, TrustedImm32(-2147483647-1)));
+ m_jit.assembler().div(dividendGPR, divisorGPR);
+ m_jit.assembler().mfhi(remainderGPR);
+
+ if (!nodeCanIgnoreNegativeZero(node->arithNodeFlags())) {
+ // Check that we're not about to create negative zero.
+ JITCompiler::Jump numeratorPositive = m_jit.branch32(JITCompiler::GreaterThanOrEqual, dividendGPR, TrustedImm32(0));
+ speculationCheck(NegativeZero, JSValueRegs(), 0, m_jit.branchTest32(JITCompiler::Zero, remainderGPR));
+ numeratorPositive.link(&m_jit);
+ }
+
+ integerResult(remainderGPR, node);
#else // not architecture that can do integer division
// Do this the *safest* way possible: call out to a C function that will do the modulo,
// and then attempt to convert back.
@@ -3204,12 +3222,28 @@
m_jit.storePtr(TrustedImmPtr(0), JITCompiler::Address(resultGPR, JSRopeString::offsetOfFibers() + sizeof(WriteBarrier<JSString>) * i));
m_jit.load32(JITCompiler::Address(opGPRs[0], JSString::offsetOfFlags()), scratchGPR);
m_jit.load32(JITCompiler::Address(opGPRs[0], JSString::offsetOfLength()), allocatorGPR);
+ if (!ASSERT_DISABLED) {
+ JITCompiler::Jump ok = m_jit.branch32(
+ JITCompiler::GreaterThanOrEqual, allocatorGPR, TrustedImm32(0));
+ m_jit.breakpoint();
+ ok.link(&m_jit);
+ }
for (unsigned i = 1; i < numOpGPRs; ++i) {
m_jit.and32(JITCompiler::Address(opGPRs[i], JSString::offsetOfFlags()), scratchGPR);
- m_jit.add32(JITCompiler::Address(opGPRs[i], JSString::offsetOfLength()), allocatorGPR);
+ speculationCheck(
+ Uncountable, JSValueSource(), 0,
+ m_jit.branchAdd32(
+ JITCompiler::Overflow,
+ JITCompiler::Address(opGPRs[i], JSString::offsetOfLength()), allocatorGPR));
}
m_jit.and32(JITCompiler::TrustedImm32(JSString::Is8Bit), scratchGPR);
m_jit.store32(scratchGPR, JITCompiler::Address(resultGPR, JSString::offsetOfFlags()));
+ if (!ASSERT_DISABLED) {
+ JITCompiler::Jump ok = m_jit.branch32(
+ JITCompiler::GreaterThanOrEqual, allocatorGPR, TrustedImm32(0));
+ m_jit.breakpoint();
+ ok.link(&m_jit);
+ }
m_jit.store32(allocatorGPR, JITCompiler::Address(resultGPR, JSString::offsetOfLength()));
switch (numOpGPRs) {
@@ -3523,6 +3557,49 @@
integerResult(quotient.gpr(), node);
}
+#elif CPU(MIPS)
+void SpeculativeJIT::compileIntegerArithDivForMIPS(Node* node)
+{
+ SpeculateIntegerOperand op1(this, node->child1());
+ SpeculateIntegerOperand op2(this, node->child2());
+ GPRTemporary quotient(this);
+ GPRReg op1GPR = op1.gpr();
+ GPRReg op2GPR = op2.gpr();
+ GPRReg quotientGPR = quotient.gpr();
+ JITCompiler::Jump done;
+
+ // If the user cares about negative zero, then speculate that we're not about
+ // to produce negative zero.
+ if (!nodeCanIgnoreNegativeZero(node->arithNodeFlags())) {
+ MacroAssembler::Jump numeratorNonZero = m_jit.branchTest32(MacroAssembler::NonZero, op1GPR);
+ speculationCheck(NegativeZero, JSValueRegs(), 0, m_jit.branch32(MacroAssembler::LessThan, op2GPR, TrustedImm32(0)));
+ numeratorNonZero.link(&m_jit);
+ }
+
+ if (nodeUsedAsNumber(node->arithNodeFlags())) {
+ speculationCheck(Overflow, JSValueRegs(), 0, m_jit.branchTest32(JITCompiler::Zero, op2GPR));
+ speculationCheck(Overflow, JSValueRegs(), 0, m_jit.branch32(JITCompiler::Equal, op1GPR, TrustedImm32(-2147483647-1)));
+ } else {
+ JITCompiler::Jump notZero = m_jit.branchTest32(JITCompiler::NonZero, op2GPR);
+ m_jit.move(TrustedImm32(0), quotientGPR);
+ done = m_jit.jump();
+ notZero.link(&m_jit);
+ }
+
+ m_jit.assembler().div(op1GPR, op2GPR);
+ m_jit.assembler().mflo(quotientGPR);
+
+ // Check that there was no remainder. If there had been, then we'd be obligated to
+ // produce a double result instead.
+ if (nodeUsedAsNumber(node->arithNodeFlags())) {
+ GPRTemporary remainder(this);
+ m_jit.assembler().mfhi(remainder.gpr());
+ speculationCheck(Overflow, JSValueRegs(), 0, m_jit.branchTest32(MacroAssembler::NonZero, remainder.gpr()));
+ } else
+ done.link(&m_jit);
+
+ integerResult(quotientGPR, node);
+}
#endif
void SpeculativeJIT::compileArithMod(Node* node)
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h
^
|
@@ -1033,12 +1033,6 @@
return appendCallWithExceptionCheck(operation);
}
- JITCompiler::Call callOperation(V_DFGOperation_EOZD operation, GPRReg arg1, GPRReg arg2, FPRReg arg3)
- {
- m_jit.setupArgumentsWithExecState(arg1, arg2, arg3);
- return appendCallWithExceptionCheck(operation);
- }
-
JITCompiler::Call callOperation(V_DFGOperation_W operation, WatchpointSet* watchpointSet)
{
m_jit.setupArguments(TrustedImmPtr(watchpointSet));
@@ -1264,6 +1258,12 @@
return appendCallWithExceptionCheckSetResult(operation, result);
}
+ JITCompiler::Call callOperation(V_DFGOperation_EOZD operation, GPRReg arg1, GPRReg arg2, FPRReg arg3)
+ {
+ m_jit.setupArgumentsWithExecState(arg1, arg2, arg3);
+ return appendCallWithExceptionCheck(operation);
+ }
+
JITCompiler::Call callOperation(V_DFGOperation_EJPP operation, GPRReg arg1, GPRReg arg2, void* pointer)
{
m_jit.setupArgumentsWithExecState(arg1, arg2, TrustedImmPtr(pointer));
@@ -1411,7 +1411,7 @@
}
JITCompiler::Call callOperation(J_DFGOperation_EDA operation, GPRReg resultTag, GPRReg resultPayload, FPRReg arg1, GPRReg arg2)
{
- m_jit.setupArgumentsWithExecState(arg1, arg2);
+ m_jit.setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG arg1, arg2);
return appendCallWithExceptionCheckSetResult(operation, resultPayload, resultTag);
}
JITCompiler::Call callOperation(J_DFGOperation_EJA operation, GPRReg resultTag, GPRReg resultPayload, GPRReg arg1Tag, GPRReg arg1Payload, GPRReg arg2)
@@ -1511,6 +1511,12 @@
return appendCallWithExceptionCheckSetResult(operation, resultPayload, resultTag);
}
+ JITCompiler::Call callOperation(V_DFGOperation_EOZD operation, GPRReg arg1, GPRReg arg2, FPRReg arg3)
+ {
+ m_jit.setupArgumentsWithExecState(arg1, arg2, EABI_32BIT_DUMMY_ARG arg3);
+ return appendCallWithExceptionCheck(operation);
+ }
+
JITCompiler::Call callOperation(V_DFGOperation_EJPP operation, GPRReg arg1Tag, GPRReg arg1Payload, GPRReg arg2, void* pointer)
{
m_jit.setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG arg1Payload, arg1Tag, arg2, TrustedImmPtr(pointer));
@@ -1994,6 +2000,8 @@
void compileIntegerArithDivForX86(Node*);
#elif CPU(APPLE_ARMV7S)
void compileIntegerArithDivForARMv7s(Node*);
+#elif CPU(MIPS)
+ void compileIntegerArithDivForMIPS(Node*);
#endif
void compileArithMod(Node*);
void compileSoftModulo(Node*);
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp
^
|
@@ -421,8 +421,7 @@
notCell.link(&m_jit);
// null or undefined?
COMPILE_ASSERT((JSValue::UndefinedTag | 1) == JSValue::NullTag, UndefinedTag_OR_1_EQUALS_NullTag);
- m_jit.move(argTagGPR, resultPayloadGPR);
- m_jit.or32(TrustedImm32(1), resultPayloadGPR);
+ m_jit.or32(TrustedImm32(1), argTagGPR, resultPayloadGPR);
m_jit.compare32(invert ? JITCompiler::NotEqual : JITCompiler::Equal, resultPayloadGPR, TrustedImm32(JSValue::NullTag), resultPayloadGPR);
done.link(&m_jit);
@@ -483,8 +482,7 @@
notCell.link(&m_jit);
// null or undefined?
COMPILE_ASSERT((JSValue::UndefinedTag | 1) == JSValue::NullTag, UndefinedTag_OR_1_EQUALS_NullTag);
- m_jit.move(argTagGPR, resultGPR);
- m_jit.or32(TrustedImm32(1), resultGPR);
+ m_jit.or32(TrustedImm32(1), argTagGPR, resultGPR);
branch32(invert ? JITCompiler::NotEqual : JITCompiler::Equal, resultGPR, JITCompiler::TrustedImm32(JSValue::NullTag), taken);
}
@@ -1106,6 +1104,10 @@
switch (info.registerFormat()) {
case DataFormatNone: {
+ if (info.spillFormat() == DataFormatInteger || info.spillFormat() == DataFormatDouble) {
+ terminateSpeculativeExecution(Uncountable, JSValueRegs(), 0);
+ return allocate();
+ }
if (edge->hasConstant()) {
JSValue jsValue = valueOfJSConstant(edge.node());
@@ -1422,8 +1424,7 @@
// We know that within this branch, rightChild must not be a cell. Check if that is enough to
// prove that it is either null or undefined.
if (needsTypeCheck(rightChild, SpecCell | SpecOther)) {
- m_jit.move(op2TagGPR, resultGPR);
- m_jit.or32(TrustedImm32(1), resultGPR);
+ m_jit.or32(TrustedImm32(1), op2TagGPR, resultGPR);
typeCheck(
JSValueRegs(op2TagGPR, op2PayloadGPR), rightChild, SpecCell | SpecOther,
@@ -1531,8 +1532,7 @@
jump(notTaken, ForceJump);
rightNotCell.link(&m_jit);
- m_jit.move(op2TagGPR, resultGPR);
- m_jit.or32(TrustedImm32(1), resultGPR);
+ m_jit.or32(TrustedImm32(1), op2TagGPR, resultGPR);
typeCheck(
JSValueRegs(op2TagGPR, op2PayloadGPR), rightChild, SpecCell | SpecOther,
@@ -1653,8 +1653,7 @@
COMPILE_ASSERT((JSValue::UndefinedTag | 1) == JSValue::NullTag, UndefinedTag_OR_1_EQUALS_NullTag);
if (needsTypeCheck(nodeUse, SpecCell | SpecOther)) {
- m_jit.move(valueTagGPR, resultPayloadGPR);
- m_jit.or32(TrustedImm32(1), resultPayloadGPR);
+ m_jit.or32(TrustedImm32(1), valueTagGPR, resultPayloadGPR);
typeCheck(
JSValueRegs(valueTagGPR, valuePayloadGPR), nodeUse, SpecCell | SpecOther,
m_jit.branch32(
@@ -1778,8 +1777,7 @@
COMPILE_ASSERT((JSValue::UndefinedTag | 1) == JSValue::NullTag, UndefinedTag_OR_1_EQUALS_NullTag);
if (needsTypeCheck(nodeUse, SpecCell | SpecOther)) {
- m_jit.move(valueTagGPR, scratchGPR);
- m_jit.or32(TrustedImm32(1), scratchGPR);
+ m_jit.or32(TrustedImm32(1), valueTagGPR, scratchGPR);
typeCheck(
JSValueRegs(valueTagGPR, valuePayloadGPR), nodeUse, SpecCell | SpecOther,
m_jit.branch32(MacroAssembler::NotEqual, scratchGPR, TrustedImm32(JSValue::NullTag)));
@@ -2255,6 +2253,8 @@
compileIntegerArithDivForX86(node);
#elif CPU(APPLE_ARMV7S)
compileIntegerArithDivForARMv7s(node);
+#elif CPU(MIPS)
+ compileIntegerArithDivForMIPS(node);
#else // CPU type without integer divide
RELEASE_ASSERT_NOT_REACHED(); // should have been coverted into a double divide.
#endif
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/JavaScriptCore/disassembler/udis86/itab.py
^
|
@@ -314,7 +314,7 @@
self.ItabH.write( "\n" )
self.ItabH.write("\n/* itab entry operand definitions */\n");
- operands = self.OperandDict.keys()
+ operands = list( self.OperandDict.keys() )
operands.sort()
for o in operands:
self.ItabH.write("#define O_%-7s { %-12s %-8s }\n" %
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/JavaScriptCore/heap/HeapStatistics.cpp
^
|
@@ -232,22 +232,23 @@
dataLogF("\n=== Heap Statistics: ===\n");
dataLogF("size: %ldkB\n", static_cast<long>(heap->m_sizeAfterLastCollect / KB));
dataLogF("capacity: %ldkB\n", static_cast<long>(heap->capacity() / KB));
- dataLogF("pause time: %lfms\n\n", heap->m_lastGCLength);
+ dataLogF("pause time: %lfs\n\n", heap->m_lastGCLength);
StorageStatistics storageStatistics;
heap->m_objectSpace.forEachLiveCell(storageStatistics);
- dataLogF("wasted .property storage: %ldkB (%ld%%)\n",
- static_cast<long>(
- (storageStatistics.storageCapacity() - storageStatistics.storageSize()) / KB),
- static_cast<long>(
- (storageStatistics.storageCapacity() - storageStatistics.storageSize()) * 100
- / storageStatistics.storageCapacity()));
- dataLogF("objects with out-of-line .property storage: %ld (%ld%%)\n",
- static_cast<long>(
- storageStatistics.objectWithOutOfLineStorageCount()),
- static_cast<long>(
- storageStatistics.objectWithOutOfLineStorageCount() * 100
- / storageStatistics.objectCount()));
+ long wastedPropertyStorageBytes = 0;
+ long wastedPropertyStoragePercent = 0;
+ long objectWithOutOfLineStorageCount = 0;
+ long objectsWithOutOfLineStoragePercent = 0;
+ if ((storageStatistics.storageCapacity() > 0) && (storageStatistics.objectCount() > 0)) {
+ wastedPropertyStorageBytes = static_cast<long>((storageStatistics.storageCapacity() - storageStatistics.storageSize()) / KB);
+ wastedPropertyStoragePercent = static_cast<long>(
+ (storageStatistics.storageCapacity() - storageStatistics.storageSize()) * 100 / storageStatistics.storageCapacity());
+ objectWithOutOfLineStorageCount = static_cast<long>(storageStatistics.objectWithOutOfLineStorageCount());
+ objectsWithOutOfLineStoragePercent = objectWithOutOfLineStorageCount * 100 / storageStatistics.objectCount();
+ }
+ dataLogF("wasted .property storage: %ldkB (%ld%%)\n", wastedPropertyStorageBytes, wastedPropertyStoragePercent);
+ dataLogF("objects with out-of-line .property storage: %ld (%ld%%)\n", objectWithOutOfLineStorageCount, objectsWithOutOfLineStoragePercent);
}
} // namespace JSC
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/JavaScriptCore/heap/SlotVisitorInlines.h
^
|
@@ -174,6 +174,7 @@
inline void SlotVisitor::copyLater(JSCell* owner, void* ptr, size_t bytes)
{
+ ASSERT(bytes);
CopiedBlock* block = CopiedSpace::blockFor(ptr);
if (block->isOversize()) {
m_shared.m_copiedSpace->pin(block);
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/JavaScriptCore/jit/ExecutableAllocator.h
^
|
@@ -102,7 +102,7 @@
#endif
#if ENABLE(EXECUTABLE_ALLOCATOR_FIXED)
-#if CPU(ARM)
+#if CPU(ARM) || CPU(MIPS)
static const size_t fixedExecutableMemoryPoolSize = 16 * 1024 * 1024;
#elif CPU(X86_64) && !CPU(X32)
static const size_t fixedExecutableMemoryPoolSize = 1024 * 1024 * 1024;
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/JavaScriptCore/jit/ExecutableAllocatorFixedVMPool.cpp
^
|
@@ -31,20 +31,12 @@
#include "CodeProfiling.h"
#include <errno.h>
-#include <unistd.h>
#include <wtf/MetaAllocator.h>
#include <wtf/PageReservation.h>
#include <wtf/VMTags.h>
-#if OS(DARWIN)
-#include <sys/mman.h>
-#endif
-
-#if OS(LINUX)
-#include <stdio.h>
-#endif
-
#if !PLATFORM(IOS) && PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < 1090
+#include <sys/mman.h>
// MADV_FREE_REUSABLE does not work for JIT memory on older OSes so use MADV_FREE in that case.
#define WTF_USE_MADV_FREE_FOR_JIT_MEMORY 1
#endif
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/JavaScriptCore/jit/JITStubs.h
^
|
@@ -140,10 +140,10 @@
ReturnAddressPtr* returnAddressSlot() { return reinterpret_cast<ReturnAddressPtr*>(this) - 1; }
};
#elif CPU(X86)
-#if COMPILER(MSVC) || (OS(WINDOWS) && COMPILER(GCC))
+#if COMPILER(MSVC) || (OS(WINDOWS) && COMPILER(GCC)) || OS(QNX)
#pragma pack(push)
#pragma pack(4)
-#endif // COMPILER(MSVC) || (OS(WINDOWS) && COMPILER(GCC))
+#endif // COMPILER(MSVC) || (OS(WINDOWS) && COMPILER(GCC)) || OS(QNX)
struct JITStackFrame {
void* reserved; // Unused
JITStubArg args[6];
@@ -167,9 +167,9 @@
// When JIT code makes a call, it pushes its return address just below the rest of the stack.
ReturnAddressPtr* returnAddressSlot() { return reinterpret_cast<ReturnAddressPtr*>(this) - 1; }
};
-#if COMPILER(MSVC) || (OS(WINDOWS) && COMPILER(GCC))
+#if COMPILER(MSVC) || (OS(WINDOWS) && COMPILER(GCC)) || OS(QNX)
#pragma pack(pop)
-#endif // COMPILER(MSVC) || (OS(WINDOWS) && COMPILER(GCC))
+#endif // COMPILER(MSVC) || (OS(WINDOWS) && COMPILER(GCC)) || OS(QNX)
#elif CPU(ARM_THUMB2)
struct JITStackFrame {
JITStubArg reserved; // Unused
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/JavaScriptCore/llint/LLIntData.cpp
^
|
@@ -116,7 +116,11 @@
#if !ASSERT_DISABLED
Vector<int> testVector;
testVector.resize(42);
+#if USE(JSVALUE64) && OS(WINDOWS)
+ ASSERT(bitwise_cast<uint32_t*>(&testVector)[4] == 42);
+#else
ASSERT(bitwise_cast<uint32_t*>(&testVector)[sizeof(void*)/sizeof(uint32_t) + 1] == 42);
+#endif
ASSERT(bitwise_cast<int**>(&testVector)[0] == testVector.begin());
#endif
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/JavaScriptCore/llint/LLIntOfflineAsmConfig.h
^
|
@@ -104,6 +104,12 @@
#define OFFLINE_ASM_JSVALUE64 0
#endif
+#if USE(JSVALUE64) && OS(WINDOWS)
+#define OFFLINE_ASM_WIN64 1
+#else
+#define OFFLINE_ASM_WIN64 0
+#endif
+
#if !ASSERT_DISABLED
#define OFFLINE_ASM_ASSERT_ENABLED 1
#else
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/JavaScriptCore/llint/LowLevelInterpreter.asm
^
|
@@ -87,6 +87,12 @@
const PayloadOffset = 0
end
+if JSVALUE64
+ const JSCellPayloadOffset = 0
+else
+ const JSCellPayloadOffset = PayloadOffset
+end
+
# Constant for reasoning about butterflies.
const IsArray = 1
const IndexingShapeMask = 30
@@ -155,13 +161,14 @@
# This must match wtf/Vector.h
const VectorBufferOffset = 0
-if JSVALUE64
+if WIN64
+ const VectorSizeOffset = 16
+elsif JSVALUE64
const VectorSizeOffset = 12
else
const VectorSizeOffset = 8
end
-
# Some common utilities.
macro crash()
if C_LOOP
@@ -267,13 +274,13 @@
end
macro functionForCallCodeBlockGetter(targetRegister)
- loadp Callee[cfr], targetRegister
+ loadp Callee + JSCellPayloadOffset[cfr], targetRegister
loadp JSFunction::m_executable[targetRegister], targetRegister
loadp FunctionExecutable::m_codeBlockForCall[targetRegister], targetRegister
end
macro functionForConstructCodeBlockGetter(targetRegister)
- loadp Callee[cfr], targetRegister
+ loadp Callee + JSCellPayloadOffset[cfr], targetRegister
loadp JSFunction::m_executable[targetRegister], targetRegister
loadp FunctionExecutable::m_codeBlockForConstruct[targetRegister], targetRegister
end
@@ -671,7 +678,7 @@
macro resolveScopedVarBody(resolveOperations)
# First ResolveOperation is to skip scope chain nodes
getScope(macro(dest)
- loadp ScopeChain + PayloadOffset[cfr], dest
+ loadp ScopeChain + JSCellPayloadOffset[cfr], dest
end,
ResolveOperation::m_scopesToSkip[resolveOperations], t1, t2)
loadp JSVariableObject::m_registers[t1], t1 # t1 now contains the activation registers
@@ -696,7 +703,7 @@
loadisFromInstruction(1, t3)
# We know we want the top scope chain entry
- loadp ScopeChain + PayloadOffset[cfr], t1
+ loadp ScopeChain + JSCellPayloadOffset[cfr], t1
loadp JSVariableObject::m_registers[t1], t1 # t1 now contains the activation registers
# Second ResolveOperation tells us what offset to use
@@ -718,7 +725,7 @@
loadp JSScope::m_next[t1], dest
jmp .done
.scopeChainNotCreated:
- loadp ScopeChain + PayloadOffset[cfr], dest
+ loadp ScopeChain + JSCellPayloadOffset[cfr], dest
.done:
end,
# Second ResolveOperation tells us how many more nodes to skip
@@ -773,7 +780,7 @@
getResolveOperation(4, t0)
# First ResolveOperation is to skip scope chain nodes
getScope(macro(dest)
- loadp ScopeChain + PayloadOffset[cfr], dest
+ loadp ScopeChain + JSCellPayloadOffset[cfr], dest
end,
ResolveOperation::m_scopesToSkip[t0], t1, t2)
loadisFromInstruction(1, t3)
@@ -798,7 +805,7 @@
loadp JSScope::m_next[t1], dest
jmp .done
.scopeChainNotCreated:
- loadp ScopeChain + PayloadOffset[cfr], dest
+ loadp ScopeChain + JSCellPayloadOffset[cfr], dest
.done:
end,
# Second ResolveOperation tells us how many more nodes to skip
@@ -823,7 +830,7 @@
getResolveOperation(4, t0)
btpz t0, .slowPath
- loadp ScopeChain[cfr], t3
+ loadp ScopeChain + JSCellPayloadOffset[cfr], t3
# Get the base
loadis ResolveOperation::m_operation[t0], t2
@@ -845,7 +852,7 @@
loadp JSScope::m_next[t1], dest
jmp .done
.scopeChainNotCreated:
- loadp ScopeChain + PayloadOffset[cfr], dest
+ loadp ScopeChain + JSCellPayloadOffset[cfr], dest
.done:
end,
sizeof ResolveOperation + ResolveOperation::m_scopesToSkip[t0], t1, t2)
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/JavaScriptCore/llint/LowLevelInterpreter.cpp
^
|
@@ -530,19 +530,11 @@
#define OFFLINE_ASM_OPCODE_LABEL(__opcode) OFFLINE_ASM_GLOBAL_LABEL(llint_##__opcode)
#define OFFLINE_ASM_GLUE_LABEL(__opcode) OFFLINE_ASM_GLOBAL_LABEL(__opcode)
-#if CPU(ARM_THUMB2)
-#define OFFLINE_ASM_GLOBAL_LABEL(label) \
- ".globl " SYMBOL_STRING(label) "\n" \
- HIDE_SYMBOL(label) "\n" \
- ".thumb\n" \
- ".thumb_func " THUMB_FUNC_PARAM(label) "\n" \
- SYMBOL_STRING(label) ":\n"
-#else
#define OFFLINE_ASM_GLOBAL_LABEL(label) \
".globl " SYMBOL_STRING(label) "\n" \
HIDE_SYMBOL(label) "\n" \
+ INLINE_ARM_FUNCTION(label) \
SYMBOL_STRING(label) ":\n"
-#endif
#define OFFLINE_ASM_LOCAL_LABEL(label) LOCAL_LABEL_STRING(label) ":\n"
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm
^
|
@@ -1692,7 +1692,7 @@
loadi 20[PC], t2
loadi PayloadOffset[cfr, t2, 8], t2
loadp JSPropertyNameIterator::m_jsStrings[t2], t3
- loadi [t3, t0, 8], t3
+ loadi PayloadOffset[t3, t0, 8], t3
addi 1, t0
storei t0, PayloadOffset[cfr, t1, 8]
loadi 4[PC], t1
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/JavaScriptCore/offlineasm/mips.rb
^
|
@@ -231,9 +231,10 @@
[node.operands[0], MIPS_ZERO_REG, node.operands[-1]],
node.annotation)
elsif node.operands.size == 3
+ tl = condOp[-1, 1]
tmp = Tmp.new(node.codeOrigin, :gpr)
list << Instruction.new(node.codeOrigin,
- "andi",
+ "and" + tl,
[node.operands[0], node.operands[1], tmp],
node.annotation)
list << Instruction.new(node.codeOrigin,
@@ -503,6 +504,10 @@
newList << Instruction.new(node.codeOrigin,
node.opcode,
riscAsRegisters(newList, [], node.operands, "b"))
+ when "andb"
+ newList << Instruction.new(node.codeOrigin,
+ "andi",
+ riscAsRegisters(newList, [], node.operands, "b"))
when /^(bz|bnz|bs|bo)/
tl = $~.post_match == "" ? "i" : $~.post_match
newList << Instruction.new(node.codeOrigin,
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/JavaScriptCore/parser/NodeConstructors.h
^
|
@@ -517,7 +517,7 @@
}
inline LogicalOpNode::LogicalOpNode(const JSTokenLocation& location, ExpressionNode* expr1, ExpressionNode* expr2, LogicalOperator oper)
- : ExpressionNode(location, ResultType::booleanType())
+ : ExpressionNode(location, ResultType::forLogicalOp(expr1->resultDescriptor(), expr2->resultDescriptor()))
, m_expr1(expr1)
, m_expr2(expr2)
, m_operator(oper)
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/JavaScriptCore/parser/ParserArena.h
^
|
@@ -71,6 +71,10 @@
template <typename T>
ALWAYS_INLINE const Identifier& IdentifierArena::makeIdentifier(VM* vm, const T* characters, size_t length)
{
+ if (length == 0) {
+ m_identifiers.append(Identifier(Identifier::EmptyIdentifier));
+ return m_identifiers.last();
+ }
if (characters[0] >= MaximumCachableCharacter) {
m_identifiers.append(Identifier(vm, characters, length));
return m_identifiers.last();
@@ -92,6 +96,10 @@
ALWAYS_INLINE const Identifier& IdentifierArena::makeIdentifierLCharFromUChar(VM* vm, const UChar* characters, size_t length)
{
+ if (length == 0) {
+ m_identifiers.append(Identifier(Identifier::EmptyIdentifier));
+ return m_identifiers.last();
+ }
if (characters[0] >= MaximumCachableCharacter) {
m_identifiers.append(Identifier::createLCharFromUChar(vm, characters, length));
return m_identifiers.last();
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/JavaScriptCore/parser/ResultType.h
^
|
@@ -120,7 +120,20 @@
return stringType();
return stringOrNumberType();
}
-
+
+ // Unlike in C, a logical op produces the value of the
+ // last expression evaluated (and not true or false).
+ static ResultType forLogicalOp(ResultType op1, ResultType op2)
+ {
+ if (op1.definitelyIsBoolean() && op2.definitelyIsBoolean())
+ return booleanType();
+ if (op1.definitelyIsNumber() && op2.definitelyIsNumber())
+ return numberType();
+ if (op1.definitelyIsString() && op2.definitelyIsString())
+ return stringType();
+ return unknownType();
+ }
+
static ResultType forBitOp()
{
return numberTypeIsInt32();
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/JavaScriptCore/runtime/JSArray.cpp
^
|
@@ -755,21 +755,21 @@
// so only if it's not horribly slow.
if (oldLength - (startIndex + count) >= MIN_SPARSE_ARRAY_INDEX)
return shiftCountWithArrayStorage(startIndex, count, ensureArrayStorage(exec->vm()));
-
+
+ // Storing to a hole is fine since we're still having a good time. But reading from a hole
+ // is totally not fine, since we might have to read from the proto chain.
+ // We have to check for holes before we start moving things around so that we don't get halfway
+ // through shifting and then realize we should have been in ArrayStorage mode.
unsigned end = oldLength - count;
for (unsigned i = startIndex; i < end; ++i) {
- // Storing to a hole is fine since we're still having a good time. But reading
- // from a hole is totally not fine, since we might have to read from the proto
- // chain.
JSValue v = m_butterfly->contiguous()[i + count].get();
- if (UNLIKELY(!v)) {
- // The purpose of this path is to ensure that we don't make the same
- // mistake in the future: shiftCountWithArrayStorage() can't do anything
- // about holes (at least for now), but it can detect them quickly. So
- // we convert to array storage and then allow the array storage path to
- // figure it out.
+ if (UNLIKELY(!v))
return shiftCountWithArrayStorage(startIndex, count, ensureArrayStorage(exec->vm()));
- }
+ }
+
+ for (unsigned i = startIndex; i < end; ++i) {
+ JSValue v = m_butterfly->contiguous()[i + count].get();
+ ASSERT(v);
// No need for a barrier since we're just moving data around in the same vector.
// This is in line with our standing assumption that we won't have a deletion
// barrier.
@@ -790,21 +790,21 @@
// so only if it's not horribly slow.
if (oldLength - (startIndex + count) >= MIN_SPARSE_ARRAY_INDEX)
return shiftCountWithArrayStorage(startIndex, count, ensureArrayStorage(exec->vm()));
-
+
+ // Storing to a hole is fine since we're still having a good time. But reading from a hole
+ // is totally not fine, since we might have to read from the proto chain.
+ // We have to check for holes before we start moving things around so that we don't get halfway
+ // through shifting and then realize we should have been in ArrayStorage mode.
unsigned end = oldLength - count;
for (unsigned i = startIndex; i < end; ++i) {
- // Storing to a hole is fine since we're still having a good time. But reading
- // from a hole is totally not fine, since we might have to read from the proto
- // chain.
double v = m_butterfly->contiguousDouble()[i + count];
- if (UNLIKELY(v != v)) {
- // The purpose of this path is to ensure that we don't make the same
- // mistake in the future: shiftCountWithArrayStorage() can't do anything
- // about holes (at least for now), but it can detect them quickly. So
- // we convert to array storage and then allow the array storage path to
- // figure it out.
+ if (UNLIKELY(v != v))
return shiftCountWithArrayStorage(startIndex, count, ensureArrayStorage(exec->vm()));
- }
+ }
+
+ for (unsigned i = startIndex; i < end; ++i) {
+ double v = m_butterfly->contiguousDouble()[i + count];
+ ASSERT(v == v);
// No need for a barrier since we're just moving data around in the same vector.
// This is in line with our standing assumption that we won't have a deletion
// barrier.
@@ -889,11 +889,18 @@
return unshiftCountWithArrayStorage(exec, startIndex, count, ensureArrayStorage(exec->vm()));
ensureLength(exec->vm(), oldLength + count);
-
+
+ // We have to check for holes before we start moving things around so that we don't get halfway
+ // through shifting and then realize we should have been in ArrayStorage mode.
for (unsigned i = oldLength; i-- > startIndex;) {
JSValue v = m_butterfly->contiguous()[i].get();
if (UNLIKELY(!v))
return unshiftCountWithArrayStorage(exec, startIndex, count, ensureArrayStorage(exec->vm()));
+ }
+
+ for (unsigned i = oldLength; i-- > startIndex;) {
+ JSValue v = m_butterfly->contiguous()[i].get();
+ ASSERT(v);
m_butterfly->contiguous()[i + count].setWithoutWriteBarrier(v);
}
@@ -915,10 +922,17 @@
ensureLength(exec->vm(), oldLength + count);
+ // We have to check for holes before we start moving things around so that we don't get halfway
+ // through shifting and then realize we should have been in ArrayStorage mode.
for (unsigned i = oldLength; i-- > startIndex;) {
double v = m_butterfly->contiguousDouble()[i];
if (UNLIKELY(v != v))
return unshiftCountWithArrayStorage(exec, startIndex, count, ensureArrayStorage(exec->vm()));
+ }
+
+ for (unsigned i = oldLength; i-- > startIndex;) {
+ double v = m_butterfly->contiguousDouble()[i];
+ ASSERT(v == v);
m_butterfly->contiguousDouble()[i + count] = v;
}
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/JavaScriptCore/runtime/JSObject.cpp
^
|
@@ -595,7 +595,7 @@
if (mayInterceptIndexedAccesses())
return;
- setStructure(vm, Structure::nonPropertyTransition(vm, structure(), AddIndexedAccessors));
+ setStructure(vm, Structure::nonPropertyTransition(vm, structure(), AddIndexedAccessors), m_butterfly);
if (!vm.prototypeMap.isPrototype(this))
return;
@@ -681,7 +681,7 @@
ContiguousJSValues JSObject::convertUndecidedToInt32(VM& vm)
{
ASSERT(hasUndecided(structure()->indexingType()));
- setStructure(vm, Structure::nonPropertyTransition(vm, structure(), AllocateInt32));
+ setStructure(vm, Structure::nonPropertyTransition(vm, structure(), AllocateInt32), m_butterfly);
return m_butterfly->contiguousInt32();
}
@@ -692,14 +692,14 @@
for (unsigned i = m_butterfly->vectorLength(); i--;)
m_butterfly->contiguousDouble()[i] = QNaN;
- setStructure(vm, Structure::nonPropertyTransition(vm, structure(), AllocateDouble));
+ setStructure(vm, Structure::nonPropertyTransition(vm, structure(), AllocateDouble), m_butterfly);
return m_butterfly->contiguousDouble();
}
ContiguousJSValues JSObject::convertUndecidedToContiguous(VM& vm)
{
ASSERT(hasUndecided(structure()->indexingType()));
- setStructure(vm, Structure::nonPropertyTransition(vm, structure(), AllocateContiguous));
+ setStructure(vm, Structure::nonPropertyTransition(vm, structure(), AllocateContiguous), m_butterfly);
return m_butterfly->contiguous();
}
@@ -765,7 +765,7 @@
*currentAsDouble = v.asInt32();
}
- setStructure(vm, Structure::nonPropertyTransition(vm, structure(), AllocateDouble));
+ setStructure(vm, Structure::nonPropertyTransition(vm, structure(), AllocateDouble), m_butterfly);
return m_butterfly->contiguousDouble();
}
@@ -773,7 +773,7 @@
{
ASSERT(hasInt32(structure()->indexingType()));
- setStructure(vm, Structure::nonPropertyTransition(vm, structure(), AllocateContiguous));
+ setStructure(vm, Structure::nonPropertyTransition(vm, structure(), AllocateContiguous), m_butterfly);
return m_butterfly->contiguous();
}
@@ -831,7 +831,7 @@
currentAsValue->setWithoutWriteBarrier(v);
}
- setStructure(vm, Structure::nonPropertyTransition(vm, structure(), AllocateContiguous));
+ setStructure(vm, Structure::nonPropertyTransition(vm, structure(), AllocateContiguous), m_butterfly);
return m_butterfly->contiguous();
}
@@ -1129,7 +1129,7 @@
case NonArrayWithArrayStorage:
case ArrayWithArrayStorage: {
Structure* newStructure = Structure::nonPropertyTransition(vm, structure(), SwitchToSlowPutArrayStorage);
- setStructure(vm, newStructure);
+ setStructure(vm, newStructure, m_butterfly);
break;
}
@@ -1153,7 +1153,7 @@
vm.prototypeMap.addPrototype(asObject(prototype));
Structure* newStructure = Structure::changePrototypeTransition(vm, structure(), prototype);
- setStructure(vm, newStructure);
+ setStructure(vm, newStructure, m_butterfly);
if (!newStructure->anyObjectInChainMayInterceptIndexedAccesses())
return;
@@ -1213,7 +1213,7 @@
// getters and setters, though, we also need to change our Structure
// if we override an existing non-getter or non-setter.
if (slot.type() != PutPropertySlot::NewProperty)
- setStructure(vm, Structure::attributeChangeTransition(vm, structure(), propertyName, attributes));
+ setStructure(vm, Structure::attributeChangeTransition(vm, structure(), propertyName, attributes), m_butterfly);
if (attributes & ReadOnly)
structure()->setContainsReadOnlyProperties();
@@ -1570,7 +1570,7 @@
if (isSealed(vm))
return;
preventExtensions(vm);
- setStructure(vm, Structure::sealTransition(vm, structure()));
+ setStructure(vm, Structure::sealTransition(vm, structure()), m_butterfly);
}
void JSObject::freeze(VM& vm)
@@ -1578,14 +1578,14 @@
if (isFrozen(vm))
return;
preventExtensions(vm);
- setStructure(vm, Structure::freezeTransition(vm, structure()));
+ setStructure(vm, Structure::freezeTransition(vm, structure()), m_butterfly);
}
void JSObject::preventExtensions(VM& vm)
{
enterDictionaryIndexingMode(vm);
if (isExtensible())
- setStructure(vm, Structure::preventExtensionsTransition(vm, structure()));
+ setStructure(vm, Structure::preventExtensionsTransition(vm, structure()), m_butterfly);
}
// This presently will flatten to an uncachable dictionary; this is suitable
@@ -1603,7 +1603,7 @@
}
if (!structure()->isUncacheableDictionary())
- setStructure(vm, Structure::toUncacheableDictionaryTransition(vm, structure()));
+ setStructure(vm, Structure::toUncacheableDictionaryTransition(vm, structure()), m_butterfly);
for (const ClassInfo* info = classInfo(); info; info = info->parentClass) {
const HashTable* hashTable = info->propHashTable(globalObject()->globalExec());
@@ -1633,7 +1633,7 @@
return true;
}
- setStructure(vm, Structure::removePropertyTransition(vm, structure(), propertyName, offset));
+ setStructure(vm, Structure::removePropertyTransition(vm, structure(), propertyName, offset), m_butterfly);
if (offset == invalidOffset)
return false;
putDirectUndefined(offset);
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/JavaScriptCore/runtime/JSObject.h
^
|
@@ -595,6 +595,7 @@
void setButterfly(VM&, Butterfly*, Structure*);
void setButterflyWithoutChangingStructure(Butterfly*); // You probably don't want to call this.
+ void setStructure(VM&, Structure*, Butterfly* = 0);
void setStructureAndReallocateStorageIfNecessary(VM&, unsigned oldCapacity, Structure*);
void setStructureAndReallocateStorageIfNecessary(VM&, Structure*);
@@ -1109,7 +1110,7 @@
{
ASSERT(structure);
ASSERT(!butterfly == (!structure->outOfLineCapacity() && !hasIndexingHeader(structure->indexingType())));
- setStructure(vm, structure);
+ setStructure(vm, structure, butterfly);
m_butterfly = butterfly;
}
@@ -1316,7 +1317,7 @@
return true;
}
// case (2) Despecify, fall through to (3).
- setStructure(vm, Structure::despecifyFunctionTransition(vm, structure(), propertyName));
+ setStructure(vm, Structure::despecifyFunctionTransition(vm, structure(), propertyName), m_butterfly);
}
// case (3) set the slot, do the put, return.
@@ -1344,12 +1345,18 @@
return true;
}
+inline void JSObject::setStructure(VM& vm, Structure* structure, Butterfly* butterfly)
+{
+ JSCell::setStructure(vm, structure);
+ ASSERT_UNUSED(butterfly, !butterfly == !(structure->outOfLineCapacity() || hasIndexingHeader(structure->indexingType())));
+}
+
inline void JSObject::setStructureAndReallocateStorageIfNecessary(VM& vm, unsigned oldCapacity, Structure* newStructure)
{
ASSERT(oldCapacity <= newStructure->outOfLineCapacity());
if (oldCapacity == newStructure->outOfLineCapacity()) {
- setStructure(vm, newStructure);
+ setStructure(vm, newStructure, m_butterfly);
return;
}
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/JavaScriptCore/runtime/JSString.cpp
^
|
@@ -40,6 +40,7 @@
{
ASSERT(m_index == JSRopeString::s_maxInternalRopeLength);
JSString* jsString = m_jsString;
+ RELEASE_ASSERT(jsString);
m_jsString = jsStringBuilder(&m_vm);
m_index = 0;
append(jsString);
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/JavaScriptCore/runtime/JSString.h
^
|
@@ -1,7 +1,7 @@
/*
* Copyright (C) 1999-2001 Harri Porten (porten@kde.org)
* Copyright (C) 2001 Peter Kelly (pmk@post.com)
- * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2014 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -121,7 +121,8 @@
static JSString* create(VM& vm, PassRefPtr<StringImpl> value)
{
ASSERT(value);
- size_t length = value->length();
+ int32_t length = value->length();
+ RELEASE_ASSERT(length >= 0);
size_t cost = value->cost();
JSString* newString = new (NotNull, allocateCell<JSString>(vm.heap)) JSString(vm, value);
newString->finishCreation(vm, length, cost);
@@ -226,15 +227,21 @@
{
}
- void append(JSString* jsString)
+ bool append(JSString* jsString)
{
if (m_index == JSRopeString::s_maxInternalRopeLength)
expand();
+ if (static_cast<int32_t>(m_jsString->length() + jsString->length()) < 0) {
+ m_jsString = 0;
+ return false;
+ }
m_jsString->append(m_vm, m_index++, jsString);
+ return true;
}
JSRopeString* release()
{
+ RELEASE_ASSERT(m_jsString);
JSRopeString* tmp = m_jsString;
m_jsString = 0;
return tmp;
@@ -284,6 +291,7 @@
{
m_fibers[index].set(vm, this, jsString);
m_length += jsString->m_length;
+ RELEASE_ASSERT(static_cast<int32_t>(m_length) >= 0);
setIs8Bit(is8Bit() && jsString->is8Bit());
}
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/JavaScriptCore/runtime/NumericStrings.h
^
|
@@ -37,7 +37,7 @@
ALWAYS_INLINE String add(double d)
{
CacheEntry<double>& entry = lookup(d);
- if (d == entry.key && !entry.value.isNull())
+ if (!entry.value.isNull() && d == entry.key)
return entry.value;
entry.key = d;
entry.value = String::numberToStringECMAScript(d);
@@ -49,7 +49,7 @@
if (static_cast<unsigned>(i) < cacheSize)
return lookupSmallString(static_cast<unsigned>(i));
CacheEntry<int>& entry = lookup(i);
- if (i == entry.key && !entry.value.isNull())
+ if (!entry.value.isNull() && i == entry.key)
return entry.value;
entry.key = i;
entry.value = String::number(i);
@@ -61,7 +61,7 @@
if (i < cacheSize)
return lookupSmallString(static_cast<unsigned>(i));
CacheEntry<unsigned>& entry = lookup(i);
- if (i == entry.key && !entry.value.isNull())
+ if (!entry.value.isNull() && i == entry.key)
return entry.value;
entry.key = i;
entry.value = String::number(i);
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/JavaScriptCore/runtime/Operations.h
^
|
@@ -42,13 +42,13 @@
{
VM& vm = exec->vm();
- unsigned length1 = s1->length();
+ int32_t length1 = s1->length();
if (!length1)
return s2;
- unsigned length2 = s2->length();
+ int32_t length2 = s2->length();
if (!length2)
return s1;
- if ((length1 + length2) < length1)
+ if ((length1 + length2) < 0)
return throwOutOfMemoryError(exec);
return JSRopeString::create(vm, s1, s2);
@@ -58,9 +58,13 @@
{
VM* vm = &exec->vm();
- unsigned length1 = u1.length();
- unsigned length2 = u2.length();
- unsigned length3 = u3.length();
+ int32_t length1 = u1.length();
+ int32_t length2 = u2.length();
+ int32_t length3 = u3.length();
+
+ if (length1 < 0 || length2 < 0 || length3 < 0)
+ return throwOutOfMemoryError(exec);
+
if (!length1)
return jsString(exec, jsString(vm, u2), jsString(vm, u3));
if (!length2)
@@ -68,9 +72,9 @@
if (!length3)
return jsString(exec, jsString(vm, u1), jsString(vm, u2));
- if ((length1 + length2) < length1)
+ if ((length1 + length2) < 0)
return throwOutOfMemoryError(exec);
- if ((length1 + length2 + length3) < length3)
+ if ((length1 + length2 + length3) < 0)
return throwOutOfMemoryError(exec);
return JSRopeString::create(exec->vm(), jsString(vm, u1), jsString(vm, u2), jsString(vm, u3));
@@ -81,15 +85,11 @@
VM* vm = &exec->vm();
JSRopeString::RopeBuilder ropeBuilder(*vm);
- unsigned oldLength = 0;
-
for (unsigned i = 0; i < count; ++i) {
JSValue v = strings[i].jsValue();
- ropeBuilder.append(v.toString(exec));
- if (ropeBuilder.length() < oldLength) // True for overflow
+ if (!ropeBuilder.append(v.toString(exec)))
return throwOutOfMemoryError(exec);
- oldLength = ropeBuilder.length();
}
return ropeBuilder.release();
@@ -101,15 +101,10 @@
JSRopeString::RopeBuilder ropeBuilder(*vm);
ropeBuilder.append(thisValue.toString(exec));
- unsigned oldLength = 0;
-
for (unsigned i = 0; i < exec->argumentCount(); ++i) {
JSValue v = exec->argument(i);
- ropeBuilder.append(v.toString(exec));
-
- if (ropeBuilder.length() < oldLength) // True for overflow
+ if (!ropeBuilder.append(v.toString(exec)))
return throwOutOfMemoryError(exec);
- oldLength = ropeBuilder.length();
}
return ropeBuilder.release();
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/JavaScriptCore/runtime/StringPrototype.cpp
^
|
@@ -761,6 +761,7 @@
else {
unsigned pos;
int len = s.length();
+ RELEASE_ASSERT(len >= 0);
if (a1.isUInt32())
pos = std::min<uint32_t>(a1.asUInt32(), len);
else {
@@ -904,6 +905,7 @@
return throwVMTypeError(exec);
String s = thisValue.toString(exec)->value(exec);
int len = s.length();
+ RELEASE_ASSERT(len >= 0);
JSValue a0 = exec->argument(0);
JSValue a1 = exec->argument(1);
@@ -1216,6 +1218,7 @@
JSValue a0 = exec->argument(0);
JSValue a1 = exec->argument(1);
int len = jsString->length();
+ RELEASE_ASSERT(len >= 0);
double start = a0.toNumber(exec);
double end;
@@ -1253,6 +1256,7 @@
int sSize = s.length();
if (!sSize)
return JSValue::encode(sVal);
+ RELEASE_ASSERT(sSize >= 0);
StringImpl* ourImpl = s.impl();
RefPtr<StringImpl> lower = ourImpl->lower();
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/JavaScriptCore/runtime/Structure.cpp
^
|
@@ -649,6 +649,12 @@
}
m_dictionaryKind = NoneDictionaryKind;
+
+ // If the object had a Butterfly but after flattening/compacting we no longer have need of it,
+ // we need to zero it out because the collector depends on the Structure to know the size for copying.
+ if (object->butterfly() && !this->outOfLineCapacity() && !hasIndexingHeader(this->indexingType()))
+ object->setButterfly(vm, 0, this);
+
return this;
}
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/ThirdParty/ANGLE/Target.pri
^
|
@@ -147,9 +147,7 @@
# Make sure the derived sources are built
include(DerivedSources.pri)
-*g++* {
- QMAKE_CXXFLAGS += -Wno-unused-variable -Wno-missing-noreturn -Wno-unused-function -Wno-reorder -Wno-error -Wno-unknown-pragmas -Wno-undef
-}
+CONFIG += compiling_thirdparty_code
# We do not need anything from Qt
QT =
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/ThirdParty/leveldb/Target.pri
^
|
@@ -108,11 +108,6 @@
linux: DEFINES += OS_LINUX
freebsd*: DEFINES += OS_FREEBSD
-gcc {
- greaterThan(QT_GCC_MAJOR_VERSION, 4)|greaterThan(QT_GCC_MINOR_VERSION, 5) {
- QMAKE_CXXFLAGS_WARN_ON += -Wno-error=unused-but-set-variable
- QMAKE_CXXFLAGS += -Wno-error=unused-but-set-variable
- }
-}
+CONFIG += compiling_thirdparty_code
QT += core
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/ThirdParty/leveldb/db/version_set.cc
^
|
@@ -54,6 +54,7 @@
return sum;
}
+#if 0 // unused
namespace {
std::string IntSetToString(const std::set<uint64_t>& s) {
std::string result = "{";
@@ -67,6 +68,7 @@
return result;
}
} // namespace
+#endif
Version::~Version() {
assert(refs_ == 0);
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/ThirdParty/leveldb/port/port_qt.h
^
|
@@ -20,8 +20,7 @@
#ifndef STORAGE_LEVELDB_PORT_PORT_QT_H_
#define STORAGE_LEVELDB_PORT_PORT_QT_H_
-#include <QAtomicInteger>
-#include <QAtomicPointer>
+#include <QtCore/qatomic.h>
#include <QMutex>
#include <QWaitCondition>
@@ -34,6 +33,8 @@
#ifdef Q_CC_MSVC
#include "win/stdint.h"
#define snprintf _snprintf
+#else
+#include <stdint.h>
#endif
namespace leveldb {
@@ -61,7 +62,12 @@
Mutex* m_mutex;
};
+#if QT_VERSION >= QT_VERSION_CHECK(5, 3, 0)
typedef QAtomicInteger<int> OnceType;
+#else
+typedef QAtomicInt OnceType;
+#endif
+
#define LEVELDB_ONCE_INIT 0
inline void InitOnce(port::OnceType* once, void (*initializer)())
{
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/ThirdParty/leveldb/util/env_qt.cc
^
|
@@ -194,10 +194,10 @@
}
void waitUntilStarted() {
- if (m_started)
+ if (m_started.loadAcquire() != 0)
return;
m_mutex.lock();
- if (!m_started)
+ if (m_started.loadAcquire() == 0)
m_startCond.wait(&m_mutex);
m_mutex.unlock();
}
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WTF/WTF.pri
^
|
@@ -13,13 +13,11 @@
# Therefore WebKit provides adequate header files.
INCLUDEPATH = $${ROOT_WEBKIT_DIR}/Source/WTF/icu $$INCLUDEPATH
LIBS += -licucore
-} else {
- contains(QT_CONFIG,icu) {
- win32: LIBS += -licuin -licuuc -licudt
- else:!contains(QT_CONFIG,no-pkg-config):packagesExist("icu-i18n"): PKGCONFIG *= icu-i18n
- else:android: LIBS += -licui18n -licuuc
- else: LIBS += -licui18n -licuuc -licudata
- }
+} else:!use?(wchar_unicode): {
+ win32: LIBS += -licuin -licuuc -licudt
+ else:!contains(QT_CONFIG,no-pkg-config):packagesExist("icu-i18n"): PKGCONFIG *= icu-i18n
+ else:android: LIBS += -licui18n -licuuc
+ else: LIBS += -licui18n -licuuc -licudata
}
use?(GLIB) {
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WTF/WTF.pro
^
|
@@ -264,6 +264,8 @@
threads/BinarySemaphore.cpp
}
+use?(wchar_unicode): SOURCES += wtf/unicode/wchar/UnicodeWchar.cpp
+
QT += core
QT -= gui
@@ -276,4 +278,3 @@
# For GCC 4.5 and before we disable C++0x mode in JSC for if enabled in Qt's mkspec
QMAKE_CXXFLAGS -= -std=c++0x -std=gnu++0x -std=c++11 -std=gnu++11
}
-
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WTF/wtf/Compiler.h
^
|
@@ -62,11 +62,6 @@
#define WTF_COMPILER_SUPPORTS_CXX_STRONG_ENUMS __has_feature(cxx_strong_enums)
#define WTF_COMPILER_SUPPORTS_CXX_REFERENCE_QUALIFIED_FUNCTIONS __has_feature(cxx_reference_qualified_functions)
-#if defined(__APPLE__) && COMPILER_SUPPORTS(CXX_RVALUE_REFERENCES) && defined(_GLIBCXX_VERSION) && (_GLIBCXX_VERSION <= 20070719)
-/* WTF expects the standard library to have std::move when the compiler supports rvalue references, but some old versions of stdc++11 shipped by Apple does not. */
-#define WTF_COMPILER_SUPPORTS_CXX_RVALUE_REFERENCES 0
-#endif
-
#endif
#ifndef CLANG_PRAGMA
@@ -185,6 +180,20 @@
#define WTF_COMPILER_SUPPORTS_EABI 1
#endif
+/* Library C++11 support */
+#if COMPILER_SUPPORTS(CXX_RVALUE_REFERENCES)
+/* WTF expects the standard library to have std::move when the compiler supports rvalue references */
+#if defined(__APPLE__) && defined(_GLIBCXX_VERSION) && (_GLIBCXX_VERSION <= 20070719)
+/* Some old versions of stdc++11 shipped by Apple does not have std::move. */
+#undef WTF_COMPILER_SUPPORTS_CXX_RVALUE_REFERENCES
+#define WTF_COMPILER_SUPPORTS_CXX_RVALUE_REFERENCES 0
+#elif defined(__QNXNTO__) && (defined(_YVALS) || defined(_LIBCPP_VER))
+/* libcpp (Dinkumware) does not support std::move */
+#undef WTF_COMPILER_SUPPORTS_CXX_RVALUE_REFERENCES
+#define WTF_COMPILER_SUPPORTS_CXX_RVALUE_REFERENCES 0
+#endif
+#endif
+
/* ==== Compiler features ==== */
/* ALWAYS_INLINE */
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WTF/wtf/CurrentTime.cpp
^
|
@@ -296,6 +296,8 @@
{
ASSERT(QElapsedTimer::isMonotonic());
static QElapsedTimer timer;
+ if (!timer.isValid())
+ timer.start();
return timer.nsecsElapsed() / 1.0e9;
}
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WTF/wtf/OSAllocatorPosix.cpp
^
|
@@ -35,6 +35,15 @@
namespace WTF {
+#if CPU(MIPS)
+static bool isWithin256MB(const void* ptr, size_t length)
+{
+ const intptr_t start = reinterpret_cast<intptr_t>(ptr);
+ const intptr_t end = start + length - 1;
+ return (start & 0xf0000000) == (end & 0xf0000000);
+}
+#endif // CPU(MIPS)
+
void* OSAllocator::reserveUncommitted(size_t bytes, Usage usage, bool writable, bool executable, bool includesGuardPages)
{
#if OS(QNX)
@@ -50,12 +59,39 @@
#elif OS(LINUX)
UNUSED_PARAM(usage);
UNUSED_PARAM(writable);
+#if !CPU(MIPS)
UNUSED_PARAM(executable);
+#endif
UNUSED_PARAM(includesGuardPages);
void* result = mmap(0, bytes, PROT_NONE, MAP_NORESERVE | MAP_PRIVATE | MAP_ANON, -1, 0);
if (result == MAP_FAILED)
CRASH();
+#if CPU(MIPS)
+ // On MIPS we can use shorter j <address> jump instructions if the executable
+ // memory resides entirely within a single 256MB page (e.g. 0x3000.0000 to 0x3fff.ffff).
+ // Usually this is true for the small buffers we allocate, but we test, and upon failure
+ // we reallocate a double-size region, choose a valid region, and unmap the remainder.
+ if (executable && UNLIKELY(!isWithin256MB(result, bytes))) {
+ // Not in 256MB region, try to map double size.
+ if (munmap(result, bytes))
+ CRASH();
+ result = mmap(0, 2 * bytes, PROT_NONE, MAP_NORESERVE | MAP_PRIVATE | MAP_ANON, -1, 0);
+ if (result == MAP_FAILED)
+ CRASH();
+ if (isWithin256MB(result, bytes)) {
+ // 1st half is good, release 2nd half.
+ if (munmap(reinterpret_cast<int8_t*>(result) + bytes, bytes))
+ CRASH();
+ } else if (isWithin256MB(reinterpret_cast<int8_t*>(result) + bytes, bytes)) {
+ // 2nd half is good, release 1st half.
+ if (munmap(result, bytes))
+ CRASH();
+ } else
+ ASSERT_NOT_REACHED();
+ }
+#endif // CPU(MIPS)
+
madvise(result, bytes, MADV_DONTNEED);
#else
void* result = reserveAndCommit(bytes, usage, writable, executable, includesGuardPages);
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WTF/wtf/PassRefPtr.h
^
|
@@ -32,28 +32,18 @@
inline void adopted(const void*) { }
-#if !(PLATFORM(QT) && CPU(ARM))
- #define REF_DEREF_INLINE ALWAYS_INLINE
-#else
- // Older version of gcc used by Harmattan SDK fails to build with ALWAYS_INLINE.
- // See https://bugs.webkit.org/show_bug.cgi?id=37253 for details.
- #define REF_DEREF_INLINE inline
-#endif
-
- template<typename T> REF_DEREF_INLINE void refIfNotNull(T* ptr)
+ template<typename T> ALWAYS_INLINE void refIfNotNull(T* ptr)
{
if (LIKELY(ptr != 0))
ptr->ref();
}
- template<typename T> REF_DEREF_INLINE void derefIfNotNull(T* ptr)
+ template<typename T> ALWAYS_INLINE void derefIfNotNull(T* ptr)
{
if (LIKELY(ptr != 0))
ptr->deref();
}
- #undef REF_DEREF_INLINE
-
template<typename T> class PassRefPtr {
public:
PassRefPtr() : m_ptr(0) { }
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WTF/wtf/Platform.h
^
|
@@ -115,19 +115,26 @@
|| defined(_M_PPC) \
|| defined(__PPC)
#define WTF_CPU_PPC 1
+#ifndef __LITTLE_ENDIAN__
#define WTF_CPU_BIG_ENDIAN 1
#endif
+#endif
/* CPU(PPC64) - PowerPC 64-bit */
#if defined(__ppc64__) \
|| defined(__PPC64__)
#define WTF_CPU_PPC64 1
+#ifndef __LITTLE_ENDIAN__
#define WTF_CPU_BIG_ENDIAN 1
#endif
+#endif
/* CPU(SH4) - SuperH SH-4 */
#if defined(__SH4__)
#define WTF_CPU_SH4 1
+#ifdef __BIG_ENDIAN__
+#define WTF_CPU_BIG_ENDIAN 1
+#endif
#endif
/* CPU(SPARC32) - SPARC 32-bit */
@@ -288,14 +295,18 @@
#define WTF_THUMB_ARCH_VERSION 0
#endif
-
-/* CPU(ARMV5_OR_LOWER) - ARM instruction set v5 or earlier */
-/* On ARMv5 and below the natural alignment is required.
- And there are some other differences for v5 or earlier. */
-#if !defined(ARMV5_OR_LOWER) && !WTF_ARM_ARCH_AT_LEAST(6)
-#define WTF_CPU_ARMV5_OR_LOWER 1
+/* CPU(ARM_FEATURE_UNALIGNED) - ARM instruction set supports unaligned access */
+/* On ARMv5 and below the natural alignment is required. */
+#if !defined(WTF_CPU_ARM_FEATURE_UNALIGNED)
+#if COMPILER(GCC) && GCC_VERSION_AT_LEAST(4, 7, 0)
+/* Check for feature define in case we are building with -mno-unaligned-access or for ARMv6-M */
+#if defined(__ARM_FEATURE_UNALIGNED)
+#define WTF_CPU_ARM_FEATURE_UNALIGNED 1
+#endif
+#elif WTF_ARM_ARCH_AT_LEAST(6)
+#define WTF_CPU_ARM_FEATURE_UNALIGNED 1
+#endif
#endif
-
/* CPU(ARM_TRADITIONAL) - Thumb2 is not available, only traditional ARM (v4 or greater) */
/* CPU(ARM_THUMB2) - Thumb2 instruction set is available */
@@ -565,6 +576,10 @@
#endif /* OS(WINCE) && !PLATFORM(QT) */
+#if OS(ANDROID) && PLATFORM(QT)
+# define WTF_USE_WCHAR_UNICODE 1
+#endif
+
#if !USE(WCHAR_UNICODE)
#define WTF_USE_ICU_UNICODE 1
#endif
@@ -694,11 +709,6 @@
#define HAVE_VIRTUALALLOC 1
#endif
-#if OS(QNX)
-#define HAVE_MADV_FREE_REUSE 1
-#define HAVE_MADV_FREE 1
-#endif
-
/* ENABLE macro defaults */
/* FIXME: move out all ENABLE() defines from here to FeatureDefines.h */
@@ -759,6 +769,11 @@
#define ENABLE_JIT 0
#endif
+/* All the current JIT implementations target little-endian */
+#if CPU(BIG_ENDIAN)
+#define ENABLE_JIT 0
+#endif
+
/* Disable JIT on x32 */
#if CPU(X32)
#define ENABLE_JIT 0
@@ -799,7 +814,7 @@
#endif
/* LLINT on ARM depends on an FPU */
-#if !defined(ENABLE_LLINT) && CPU(ARM) && !CPU(ARM_HARDFP)
+#if !defined(ENABLE_LLINT) && CPU(ARM) && (!CPU(ARM_VFP) || OS(ANDROID))
#define ENABLE_LLINT 0
#endif
@@ -920,7 +935,7 @@
/* Pick which allocator to use; we only need an executable allocator if the assembler is compiled in.
On x86-64 we use a single fixed mmap, on other platforms we mmap on demand. */
#if ENABLE(ASSEMBLER)
-#if CPU(X86_64) && !OS(WINDOWS) || PLATFORM(IOS)
+#if CPU(X86_64) || PLATFORM(IOS) || CPU(MIPS)
#define ENABLE_EXECUTABLE_ALLOCATOR_FIXED 1
#else
#define ENABLE_EXECUTABLE_ALLOCATOR_DEMAND 1
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WTF/wtf/unicode/wchar/UnicodeWchar.h
^
|
@@ -26,11 +26,16 @@
#define WTF_UnicodeWchar_h
#include <stdint.h>
-#include <wchar.h>
#include <wtf/unicode/ScriptCodesFromICU.h>
#include <wtf/unicode/UnicodeMacrosFromICU.h>
-typedef wchar_t UChar;
+#ifndef ANDROID
+# include <wchar.h>
+ typedef wchar_t UChar;
+#else
+ typedef unsigned short int UChar;
+#endif
+
typedef uint32_t UChar32;
namespace WTF {
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebCore/Modules/indexeddb/IDBTransactionBackendImpl.cpp
^
|
@@ -57,6 +57,7 @@
, m_database(database)
, m_transaction(database->backingStore().get())
, m_taskTimer(this, &IDBTransactionBackendImpl::taskTimerFired)
+ , m_asyncDerefTimer(this, &IDBTransactionBackendImpl::asyncDerefTimerFired)
, m_pendingPreemptiveEvents(0)
{
// We pass a reference of this object before it can be adopted.
@@ -106,7 +107,7 @@
// The last reference to this object may be released while performing the
// abort steps below. We therefore take a self reference to keep ourselves
// alive while executing this method.
- RefPtr<IDBTransactionBackendImpl> protect(this);
+ this->ref();
m_state = Finished;
m_taskTimer.stop();
@@ -138,6 +139,18 @@
m_database->transactionFinishedAndAbortFired(this);
m_database = 0;
+
+ if (this->refCount() == 1) {
+ // We may already be iterating over active DOM Objects which would make it illegal
+ // to cause ourselves to be deleted here.
+ m_asyncDerefTimer.startOneShot(0);
+ } else
+ this->deref();
+}
+
+void IDBTransactionBackendImpl::asyncDerefTimerFired(Timer<IDBTransactionBackendImpl>*)
+{
+ this->deref();
}
bool IDBTransactionBackendImpl::isTaskQueueEmpty() const
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebCore/Modules/indexeddb/IDBTransactionBackendImpl.h
^
|
@@ -87,6 +87,7 @@
bool hasPendingTasks() const;
void taskTimerFired(Timer<IDBTransactionBackendImpl>*);
+ void asyncDerefTimerFired(Timer<IDBTransactionBackendImpl>*);
void closeOpenCursors();
const int64_t m_id;
@@ -107,6 +108,7 @@
// FIXME: delete the timer once we have threads instead.
Timer<IDBTransactionBackendImpl> m_taskTimer;
+ Timer<IDBTransactionBackendImpl> m_asyncDerefTimer;
int m_pendingPreemptiveEvents;
HashSet<IDBCursorBackendImpl*> m_openCursors;
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebCore/Target.pri
^
|
@@ -2232,6 +2232,7 @@
platform/graphics/RoundedRect.h \
platform/graphics/qt/FontCustomPlatformData.h \
platform/graphics/qt/NativeImageQt.h \
+ platform/graphics/qt/QFramebufferPaintDevice.h \
platform/graphics/qt/StillImageQt.h \
platform/graphics/qt/TransparencyLayer.h \
platform/graphics/SegmentedFontData.h \
@@ -2879,11 +2880,13 @@
platform/graphics/qt/GraphicsContextQt.cpp \
platform/graphics/qt/IconQt.cpp \
platform/graphics/qt/ImageBufferQt.cpp \
+ platform/graphics/qt/ImageBufferDataQt.cpp \
platform/graphics/qt/ImageDecoderQt.cpp \
platform/graphics/qt/ImageQt.cpp \
platform/graphics/qt/IntPointQt.cpp \
platform/graphics/qt/IntRectQt.cpp \
platform/graphics/qt/IntSizeQt.cpp \
+ platform/graphics/qt/QFramebufferPaintDevice.cpp \
platform/graphics/qt/PathQt.cpp \
platform/graphics/qt/PatternQt.cpp \
platform/graphics/qt/StillImageQt.cpp \
@@ -2978,6 +2981,12 @@
}
contains(QT_CONFIG,icu)|mac: SOURCES += platform/text/TextBreakIteratorICU.cpp
+use?(wchar_unicode): {
+ SOURCES += platform/text/wchar/TextBreakIteratorWchar.cpp \
+ platform/text/TextEncodingDetectorNone.cpp
+ SOURCES -= platform/text/TextEncodingDetectorICU.cpp
+}
+
mac {
# For Mac we use the same SmartReplace implementation as the Apple port.
SOURCES += editing/SmartReplaceCF.cpp
@@ -4187,15 +4196,15 @@
INCLUDEPATH += $$PWD/platform/graphics/gpu
- contains(QT_CONFIG, opengl) | contains(QT_CONFIG, opengles2) {
- !contains(QT_CONFIG, opengles2) {
- SOURCES += \
- platform/graphics/opengl/GraphicsContext3DOpenGL.cpp \
- platform/graphics/opengl/Extensions3DOpenGL.cpp
- } else {
+ contains(QT_CONFIG, opengl) {
+ contains(QT_CONFIG, opengles2) {
SOURCES += \
platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp \
platform/graphics/opengl/Extensions3DOpenGLES.cpp
+ } else {
+ SOURCES += \
+ platform/graphics/opengl/GraphicsContext3DOpenGL.cpp \
+ platform/graphics/opengl/Extensions3DOpenGL.cpp
}
HEADERS += platform/graphics/opengl/Extensions3DOpenGL.h
@@ -4207,7 +4216,6 @@
WEBKIT += angle
- CONFIG += opengl-shims
INCLUDEPATH += platform/graphics/gpu
}
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebCore/bindings/scripts/preprocessor.pm
^
|
@@ -64,6 +64,9 @@
my @macros = grep { $_ } split(/\s+/, $defines); # grep skips empty macros.
@macros = map { "-D$_" } @macros;
+ # Remove double quotation from $preprocessor
+ $preprocessor =~ s/\'//g;
+
my $pid = 0;
if ($Config{osname} eq "cygwin" || $Config{osname} eq 'MSWin32') {
# This call can fail if Windows rebases cygwin, so retry a few times until it succeeds.
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebCore/css/CSSCursorImageValue.cpp
^
|
@@ -67,8 +67,16 @@
{
}
+inline void CSSCursorImageValue::detachPendingImage()
+{
+ if (m_image && m_image->isPendingImage())
+ static_cast<StylePendingImage&>(*m_image).detachFromCSSValue();
+}
+
CSSCursorImageValue::~CSSCursorImageValue()
{
+ detachPendingImage();
+
#if ENABLE(SVG)
if (!isSVGCursor())
return;
@@ -153,6 +161,7 @@
RefPtr<CSSImageValue> imageValue = static_cast<CSSImageValue*>(m_imageValue.get());
// FIXME: This will fail if the <cursor> element is in a shadow DOM (bug 59827)
if (SVGCursorElement* cursorElement = resourceReferencedByCursorElement(imageValue->url(), loader->document())) {
+ detachPendingImage();
RefPtr<CSSImageValue> svgImageValue = CSSImageValue::create(cursorElement->href());
StyleCachedImage* cachedImage = svgImageValue->cachedImage(loader);
m_image = cachedImage;
@@ -161,8 +170,10 @@
}
#endif
- if (m_imageValue->isImageValue())
+ if (m_imageValue->isImageValue()) {
+ detachPendingImage();
m_image = static_cast<CSSImageValue*>(m_imageValue.get())->cachedImage(loader);
+ }
}
if (m_image && m_image->isCachedImage())
@@ -205,7 +216,8 @@
void CSSCursorImageValue::clearCachedImage()
{
- m_image = 0;
+ detachPendingImage();
+ m_image.clear();
m_accessedImage = false;
}
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebCore/css/CSSCursorImageValue.h
^
|
@@ -64,6 +64,8 @@
private:
CSSCursorImageValue(PassRefPtr<CSSValue> imageValue, bool hasHotSpot, const IntPoint& hotSpot);
+ void detachPendingImage();
+
#if ENABLE(SVG)
bool isSVGCursor() const;
String cachedImageURL();
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebCore/css/CSSImageSetValue.cpp
^
|
@@ -49,8 +49,16 @@
{
}
+inline void CSSImageSetValue::detachPendingImage()
+{
+ if (m_imageSet && m_imageSet->isPendingImage())
+ static_cast<StylePendingImage&>(*m_imageSet).detachFromCSSValue();
+}
+
CSSImageSetValue::~CSSImageSetValue()
{
+ detachPendingImage();
+
if (m_imageSet && m_imageSet->isCachedImageSet())
static_cast<StyleCachedImageSet*>(m_imageSet.get())->clearImageSetValue();
}
@@ -114,6 +122,7 @@
CachedResourceRequest request(ResourceRequest(document->completeURL(image.imageURL)));
request.setInitiator(cachedResourceRequestInitiators().css);
if (CachedResourceHandle<CachedImage> cachedImage = loader->requestImage(request)) {
+ detachPendingImage();
m_imageSet = StyleCachedImageSet::create(cachedImage.get(), image.scaleFactor, this);
m_accessedBestFitImage = true;
}
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebCore/css/CSSImageSetValue.h
^
|
@@ -71,6 +71,7 @@
CSSImageSetValue();
CSSImageSetValue(const CSSImageSetValue& cloneFrom);
+ void detachPendingImage();
void fillImageSet();
static inline bool compareByScaleFactor(ImageWithScale first, ImageWithScale second) { return first.scaleFactor < second.scaleFactor; }
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebCore/css/CSSImageValue.cpp
^
|
@@ -51,8 +51,15 @@
{
}
+inline void CSSImageValue::detachPendingImage()
+{
+ if (m_image && m_image->isPendingImage())
+ static_cast<StylePendingImage&>(*m_image).detachFromCSSValue();
+}
+
CSSImageValue::~CSSImageValue()
{
+ detachPendingImage();
}
StyleImage* CSSImageValue::cachedOrPendingImage()
@@ -75,8 +82,10 @@
request.setInitiator(cachedResourceRequestInitiators().css);
else
request.setInitiator(m_initiatorName);
- if (CachedResourceHandle<CachedImage> cachedImage = loader->requestImage(request))
+ if (CachedResourceHandle<CachedImage> cachedImage = loader->requestImage(request)) {
+ detachPendingImage();
m_image = StyleCachedImage::create(cachedImage.get());
+ }
}
return (m_image && m_image->isCachedImage()) ? static_cast<StyleCachedImage*>(m_image.get()) : 0;
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebCore/css/CSSImageValue.h
^
|
@@ -61,6 +61,7 @@
private:
explicit CSSImageValue(const String& url);
CSSImageValue(const String& url, StyleImage*);
+ void detachPendingImage();
String m_url;
RefPtr<StyleImage> m_image;
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebCore/css/DeprecatedStyleBuilder.cpp
^
|
@@ -2152,7 +2152,7 @@
setPropertyHandler(CSSPropertyImageResolution, ApplyPropertyImageResolution::createHandler());
#endif
setPropertyHandler(CSSPropertyLeft, ApplyPropertyLength<&RenderStyle::left, &RenderStyle::setLeft, &RenderStyle::initialOffset, AutoEnabled>::createHandler());
- setPropertyHandler(CSSPropertyLetterSpacing, ApplyPropertyComputeLength<int, &RenderStyle::letterSpacing, &RenderStyle::setLetterSpacing, &RenderStyle::initialLetterWordSpacing, NormalEnabled, ThicknessDisabled, SVGZoomEnabled>::createHandler());
+ setPropertyHandler(CSSPropertyLetterSpacing, ApplyPropertyComputeLength<float, &RenderStyle::letterSpacing, &RenderStyle::setLetterSpacing, &RenderStyle::initialLetterSpacing, NormalEnabled, ThicknessDisabled, SVGZoomEnabled>::createHandler());
setPropertyHandler(CSSPropertyLineHeight, ApplyPropertyLineHeight::createHandler());
setPropertyHandler(CSSPropertyListStyleImage, ApplyPropertyStyleImage<&RenderStyle::listStyleImage, &RenderStyle::setListStyleImage, &RenderStyle::initialListStyleImage, CSSPropertyListStyleImage>::createHandler());
setPropertyHandler(CSSPropertyListStylePosition, ApplyPropertyDefault<EListStylePosition, &RenderStyle::listStylePosition, EListStylePosition, &RenderStyle::setListStylePosition, EListStylePosition, &RenderStyle::initialListStylePosition>::createHandler());
@@ -2357,7 +2357,7 @@
setPropertyHandler(CSSPropertyWidows, ApplyPropertyAuto<short, &RenderStyle::widows, &RenderStyle::setWidows, &RenderStyle::hasAutoWidows, &RenderStyle::setHasAutoWidows>::createHandler());
setPropertyHandler(CSSPropertyWidth, ApplyPropertyLength<&RenderStyle::width, &RenderStyle::setWidth, &RenderStyle::initialSize, AutoEnabled, LegacyIntrinsicEnabled, IntrinsicEnabled, NoneDisabled, UndefinedDisabled>::createHandler());
setPropertyHandler(CSSPropertyWordBreak, ApplyPropertyDefault<EWordBreak, &RenderStyle::wordBreak, EWordBreak, &RenderStyle::setWordBreak, EWordBreak, &RenderStyle::initialWordBreak>::createHandler());
- setPropertyHandler(CSSPropertyWordSpacing, ApplyPropertyComputeLength<int, &RenderStyle::wordSpacing, &RenderStyle::setWordSpacing, &RenderStyle::initialLetterWordSpacing, NormalEnabled, ThicknessDisabled, SVGZoomEnabled>::createHandler());
+ setPropertyHandler(CSSPropertyWordSpacing, ApplyPropertyComputeLength<float, &RenderStyle::wordSpacing, &RenderStyle::setWordSpacing, &RenderStyle::initialWordSpacing, NormalEnabled, ThicknessDisabled, SVGZoomEnabled>::createHandler());
// UAs must treat 'word-wrap' as an alternate name for the 'overflow-wrap' property. So using the same handlers.
setPropertyHandler(CSSPropertyWordWrap, ApplyPropertyDefault<EOverflowWrap, &RenderStyle::overflowWrap, EOverflowWrap, &RenderStyle::setOverflowWrap, EOverflowWrap, &RenderStyle::initialOverflowWrap>::createHandler());
setPropertyHandler(CSSPropertyZIndex, ApplyPropertyAuto<int, &RenderStyle::zIndex, &RenderStyle::setZIndex, &RenderStyle::hasAutoZIndex, &RenderStyle::setHasAutoZIndex>::createHandler());
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebCore/css/SelectorChecker.cpp
^
|
@@ -880,7 +880,7 @@
return false;
}
case CSSSelector::PseudoCornerPresent:
- return scrollbar->scrollableArea()->isScrollCornerVisible();
+ return scrollbar->scrollableArea() ? scrollbar->scrollableArea()->isScrollCornerVisible() : false;
default:
return false;
}
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebCore/dom/DOMImplementation.cpp
^
|
@@ -405,10 +405,10 @@
PluginData* pluginData = 0;
PluginData::AllowedPluginTypes allowedPluginTypes = PluginData::OnlyApplicationPlugins;
if (frame && frame->page()) {
- if (frame->loader()->subframeLoader()->allowPlugins(NotAboutToInstantiatePlugin))
+ if (frame->loader()->subframeLoader()->allowPlugins(NotAboutToInstantiatePlugin)) {
allowedPluginTypes = PluginData::AllPlugins;
-
- pluginData = frame->page()->pluginData();
+ pluginData = frame->page()->pluginData();
+ }
}
// PDF is one image type for which a plugin can override built-in support.
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebCore/dom/make_names.pl
^
|
@@ -390,6 +390,10 @@
my ($F, $tagName, $interfaceName, $constructorTagName) = @_;
# Handle media elements.
+ # Note that wrapperOnlyIfMediaIsAvailable is a misnomer, because media availability
+ # does not just control the wrapper; it controls the element object that is created.
+ # FIXME: Could we instead do this entirely in the wrapper, and use custom wrappers
+ # instead of having all the support for this here in this script?
if ($enabledTags{$tagName}{wrapperOnlyIfMediaIsAvailable}) {
print F <<END
Settings* settings = document->settings();
@@ -1042,14 +1046,11 @@
print F "#if ${conditionalString}\n\n";
}
- # Hack for the media tags
- # FIXME: This should have been done via a CustomWrapper attribute and a separate *Custom file.
if ($enabledTags{$tagName}{wrapperOnlyIfMediaIsAvailable}) {
print F <<END
static JSDOMWrapper* create${JSInterfaceName}Wrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<$parameters{namespace}Element> element)
{
- Settings* settings = element->document()->settings();
- if (!MediaPlayer::isAvailable() || (settings && !settings->mediaEnabled()))
+ if (element->isHTMLUnknownElement())
return CREATE_DOM_WRAPPER(exec, globalObject, $parameters{namespace}Element, element.get());
return CREATE_DOM_WRAPPER(exec, globalObject, ${JSInterfaceName}, element.get());
}
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebCore/html/HTMLAudioElement.h
^
|
@@ -43,14 +43,19 @@
HTMLAudioElement(const QualifiedName&, Document*, bool);
};
-inline bool isHTMLAudioElement(Node* node)
+inline bool isHTMLAudioElement(HTMLElement* element)
{
- return node->hasTagName(HTMLNames::audioTag);
+ return !element->isHTMLUnknownElement() && element->hasTagName(HTMLNames::audioTag);
}
inline bool isHTMLAudioElement(Element* element)
{
- return element->hasTagName(HTMLNames::audioTag);
+ return element->isHTMLElement() && isHTMLAudioElement(toHTMLElement(element));
+}
+
+inline bool isHTMLAudioElement(Node* node)
+{
+ return node->isHTMLElement() && isHTMLAudioElement(toHTMLElement(node));
}
inline HTMLAudioElement* toHTMLAudioElement(Node* node)
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebCore/html/HTMLCanvasElement.cpp
^
|
@@ -51,6 +51,10 @@
#include <runtime/JSLock.h>
#include <runtime/Operations.h>
+#if PLATFORM(QT)
+#include "QWebPageClient.h"
+#endif
+
#if ENABLE(WEBGL)
#include "WebGLContextAttributes.h"
#include "WebGLRenderingContext.h"
@@ -582,7 +586,15 @@
return;
RenderingMode renderingMode = shouldAccelerate(bufferSize) ? Accelerated : Unaccelerated;
- m_imageBuffer = ImageBuffer::create(size(), m_deviceScaleFactor, ColorSpaceDeviceRGB, renderingMode);
+#if PLATFORM(QT)
+ if (renderingMode == Accelerated) {
+ QWebPageClient* client = document()->page()->chrome().platformPageClient();
+ // The WebKit2 Chrome does not have a pageclient.
+ QOpenGLContext* context = client ? client->openGLContextIfAvailable() : 0;
+ m_imageBuffer = ImageBuffer::createCompatibleBuffer(size(), m_deviceScaleFactor, ColorSpaceDeviceRGB, context);
+ } else
+#endif
+ m_imageBuffer = ImageBuffer::create(size(), m_deviceScaleFactor, ColorSpaceDeviceRGB, renderingMode);
if (!m_imageBuffer)
return;
m_imageBuffer->context()->setShadowsIgnoreTransforms(true);
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebCore/html/HTMLMediaElement.cpp
^
|
@@ -374,8 +374,10 @@
}
#endif
- if (m_mediaController)
+ if (m_mediaController) {
m_mediaController->removeMediaElement(this);
+ m_mediaController = 0;
+ }
#if ENABLE(MEDIA_SOURCE)
setSourceState(MediaSource::closedKeyword());
@@ -2379,6 +2381,13 @@
bool HTMLMediaElement::paused() const
{
+ // As of this writing, JavaScript garbage collection calls this function directly. In the past
+ // we had problems where this was called on an object after a bad cast. The assertion below
+ // made our regression test detect the problem, so we should keep it because of that. But note
+ // that the value of the assertion relies on the compiler not being smart enough to know that
+ // isHTMLUnknownElement is guaranteed to return false for an HTMLMediaElement.
+ ASSERT(!isHTMLUnknownElement());
+
return m_paused;
}
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebCore/page/ChromeClient.h
^
|
@@ -266,6 +266,7 @@
FilterTrigger = 1 << 5,
ScrollableInnerFrameTrigger = 1 << 6,
AnimatedOpacityTrigger = 1 << 7,
+ LargeAreaTrigger = 1 << 8,
AllTriggers = 0xFFFFFFFF
};
typedef unsigned CompositingTriggerFlags;
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebCore/page/DOMWindow.cpp
^
|
@@ -1811,7 +1811,7 @@
return;
KURL completedURL = firstFrame->document()->completeURL(urlString);
- if (completedURL.isNull())
+ if (completedURL.isNull() || !completedURL.isValid())
return;
if (isInsecureScriptAccess(activeWindow, completedURL))
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebCore/page/animation/CSSPropertyAnimation.cpp
^
|
@@ -1129,8 +1129,8 @@
gPropertyWrappers->append(new PropertyWrapper<Length>(CSSPropertyLineHeight, &RenderStyle::specifiedLineHeight, &RenderStyle::setLineHeight));
gPropertyWrappers->append(new PropertyWrapper<int>(CSSPropertyOutlineOffset, &RenderStyle::outlineOffset, &RenderStyle::setOutlineOffset));
gPropertyWrappers->append(new PropertyWrapper<unsigned short>(CSSPropertyOutlineWidth, &RenderStyle::outlineWidth, &RenderStyle::setOutlineWidth));
- gPropertyWrappers->append(new PropertyWrapper<int>(CSSPropertyLetterSpacing, &RenderStyle::letterSpacing, &RenderStyle::setLetterSpacing));
- gPropertyWrappers->append(new PropertyWrapper<int>(CSSPropertyWordSpacing, &RenderStyle::wordSpacing, &RenderStyle::setWordSpacing));
+ gPropertyWrappers->append(new PropertyWrapper<float>(CSSPropertyLetterSpacing, &RenderStyle::letterSpacing, &RenderStyle::setLetterSpacing));
+ gPropertyWrappers->append(new PropertyWrapper<float>(CSSPropertyWordSpacing, &RenderStyle::wordSpacing, &RenderStyle::setWordSpacing));
gPropertyWrappers->append(new PropertyWrapper<Length>(CSSPropertyTextIndent, &RenderStyle::textIndent, &RenderStyle::setTextIndent));
gPropertyWrappers->append(new PropertyWrapper<float>(CSSPropertyWebkitPerspective, &RenderStyle::perspective, &RenderStyle::setPerspective));
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebCore/platform/MIMETypeRegistry.cpp
^
|
@@ -252,22 +252,11 @@
#endif
#if PLATFORM(QT)
-#if QT_VERSION >= QT_VERSION_CHECK(5, 1, 0)
QList<QByteArray> mimeTypes = QImageReader::supportedMimeTypes();
Q_FOREACH(const QByteArray& mimeType, mimeTypes) {
supportedImageMIMETypes->add(mimeType.constData());
supportedImageResourceMIMETypes->add(mimeType.constData());
}
-#else
- QList<QByteArray> formats = QImageReader::supportedImageFormats();
- for (int i = 0; i < formats.size(); ++i) {
- String mimeType = MIMETypeRegistry::getMIMETypeForExtension(formats.at(i).constData());
- if (!mimeType.isEmpty()) {
- supportedImageMIMETypes->add(mimeType);
- supportedImageResourceMIMETypes->add(mimeType);
- }
- }
-#endif // QT_VERSION
#if ENABLE(SVG)
// Do not treat SVG as images directly if WebKit can handle them.
supportedImageMIMETypes->remove("image/svg+xml");
@@ -299,19 +288,10 @@
supportedImageMIMETypesForEncoding->add("image/gif");
#endif
#elif PLATFORM(QT)
-#if QT_VERSION >= QT_VERSION_CHECK(5, 1, 0)
QList<QByteArray> mimeTypes = QImageWriter::supportedMimeTypes();
Q_FOREACH(const QByteArray& mimeType, mimeTypes) {
supportedImageMIMETypesForEncoding->add(mimeType.constData());
}
-#else
- QList<QByteArray> formats = QImageWriter::supportedImageFormats();
- for (int i = 0; i < formats.size(); ++i) {
- String mimeType = MIMETypeRegistry::getMIMETypeForExtension(formats.at(i).constData());
- if (!mimeType.isEmpty())
- supportedImageMIMETypesForEncoding->add(mimeType);
- }
-#endif // QT_VERSION
#elif PLATFORM(GTK)
supportedImageMIMETypesForEncoding->add("image/png");
supportedImageMIMETypesForEncoding->add("image/jpeg");
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebCore/platform/ThreadGlobalData.cpp
^
|
@@ -32,6 +32,7 @@
#include "InspectorCounters.h"
#include "ThreadTimers.h"
#include <wtf/MainThread.h>
+#include <wtf/PassOwnPtr.h>
#include <wtf/WTFThreadData.h>
#include <wtf/text/StringImpl.h>
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebCore/platform/graphics/Font.cpp
^
|
@@ -77,7 +77,7 @@
{
}
-Font::Font(const FontDescription& fd, short letterSpacing, short wordSpacing)
+Font::Font(const FontDescription& fd, float letterSpacing, float wordSpacing)
: m_fontDescription(fd)
, m_letterSpacing(letterSpacing)
, m_wordSpacing(wordSpacing)
@@ -297,7 +297,7 @@
}
bool hasKerningOrLigatures = typesettingFeatures() & (Kerning | Ligatures);
- bool hasWordSpacingOrLetterSpacing = wordSpacing() | letterSpacing();
+ bool hasWordSpacingOrLetterSpacing = wordSpacing() || letterSpacing();
float* cacheEntry = m_glyphs->widthCache().add(run, std::numeric_limits<float>::quiet_NaN(), hasKerningOrLigatures, hasWordSpacingOrLetterSpacing, glyphOverflow);
if (cacheEntry && !std::isnan(*cacheEntry))
return *cacheEntry;
@@ -329,7 +329,7 @@
return width(run);
}
-#if !PLATFORM(MAC)
+#if !PLATFORM(MAC) && !PLATFORM(QT)
PassOwnPtr<TextLayout> Font::createLayout(RenderText*, float, bool) const
{
return nullptr;
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebCore/platform/graphics/Font.h
^
|
@@ -85,7 +85,7 @@
class Font {
public:
Font();
- Font(const FontDescription&, short letterSpacing, short wordSpacing);
+ Font(const FontDescription&, float letterSpacing, float wordSpacing);
// This constructor is only used if the platform wants to start with a native font.
Font(const FontPlatformData&, bool isPrinting, FontSmoothingMode = AutoSmoothing);
~Font();
@@ -119,10 +119,10 @@
bool isSmallCaps() const { return m_fontDescription.smallCaps(); }
- short wordSpacing() const { return m_wordSpacing; }
- short letterSpacing() const { return m_letterSpacing; }
- void setWordSpacing(short s) { m_wordSpacing = s; }
- void setLetterSpacing(short s) { m_letterSpacing = s; }
+ float wordSpacing() const { return m_wordSpacing; }
+ float letterSpacing() const { return m_letterSpacing; }
+ void setWordSpacing(float s) { m_wordSpacing = s; }
+ void setLetterSpacing(float s) { m_letterSpacing = s; }
bool isFixedPitch() const;
bool isPrinterFont() const { return m_fontDescription.usePrinterFont(); }
@@ -212,6 +212,7 @@
friend struct WidthIterator;
friend class SVGTextRunRenderingContext;
+ friend class TextLayout;
public:
// Useful for debugging the different font rendering code paths.
@@ -307,8 +308,8 @@
FontDescription m_fontDescription;
mutable RefPtr<FontGlyphs> m_glyphs;
- short m_letterSpacing;
- short m_wordSpacing;
+ float m_letterSpacing;
+ float m_wordSpacing;
bool m_needsTranscoding;
mutable unsigned m_typesettingFeatures : 2; // (TypesettingFeatures) Caches values computed from m_fontDescription.
};
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebCore/platform/graphics/FontCache.h
^
|
@@ -76,7 +76,13 @@
{ }
static unsigned makeFlagKey(const FontDescription& description)
{
- return static_cast<unsigned>(description.widthVariant()) << 4
+ unsigned extraFlagKey = 0;
+#if PLATFORM(QT)
+ // For Qt font-smoothing is set on the font, not during painting like for Mac.
+ extraFlagKey = static_cast<unsigned>(description.fontSmoothing()) << 16;
+#endif
+ return extraFlagKey
+ | static_cast<unsigned>(description.widthVariant()) << 4
| static_cast<unsigned>(description.orientation()) << 3
| static_cast<unsigned>(description.italic()) << 2
| static_cast<unsigned>(description.usePrinterFont()) << 1
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebCore/platform/graphics/GraphicsContext.cpp
^
|
@@ -758,7 +758,7 @@
}
#endif
-#if !USE(CG) && !USE(CAIRO)
+#if !USE(CG) && !USE(CAIRO) && !PLATFORM(QT)
bool GraphicsContext::isAcceleratedContext() const
{
return false;
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebCore/platform/graphics/GraphicsContext3D.h
^
|
@@ -59,6 +59,7 @@
class QPainter;
class QRect;
class QOpenGLContext;
+class QOpenGLExtensions;
class QSurface;
QT_END_NAMESPACE
#elif PLATFORM(GTK) || PLATFORM(EFL)
@@ -84,14 +85,9 @@
namespace WebCore {
class DrawingBuffer;
class Extensions3D;
-#if USE(OPENGL_ES_2)
+class Extensions3DOpenGLCommon;
class Extensions3DOpenGLES;
-#else
class Extensions3DOpenGL;
-#endif
-#if PLATFORM(QT)
-class Extensions3DQt;
-#endif
class HostWindow;
class Image;
class ImageBuffer;
@@ -1013,16 +1009,11 @@
String mappedSymbolName(Platform3DObject program, ANGLEShaderSymbolType, const String& name);
String originalSymbolName(Platform3DObject program, ANGLEShaderSymbolType, const String& name);
- ANGLEWebKitBridge m_compiler;
#endif
-#if PLATFORM(BLACKBERRY) || (PLATFORM(QT) && defined(QT_OPENGL_ES_2)) || ((PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(WIN)) && USE(OPENGL_ES_2))
- friend class Extensions3DOpenGLES;
- OwnPtr<Extensions3DOpenGLES> m_extensions;
-#else
+ OwnPtr<Extensions3DOpenGLCommon> m_extensions;
friend class Extensions3DOpenGL;
- OwnPtr<Extensions3DOpenGL> m_extensions;
-#endif
+ friend class Extensions3DOpenGLES;
friend class Extensions3DOpenGLCommon;
Attributes m_attrs;
@@ -1066,6 +1057,10 @@
// Errors raised by synthesizeGLError().
ListHashSet<GC3Denum> m_syntheticErrors;
+#if PLATFORM(QT)
+ QOpenGLExtensions* m_functions;
+#endif
+
#if PLATFORM(BLACKBERRY)
bool m_isImaginationHardware;
#endif
@@ -1074,6 +1069,7 @@
friend class GraphicsContext3DPrivate;
OwnPtr<GraphicsContext3DPrivate> m_private;
#endif
+ ANGLEWebKitBridge m_compiler;
};
} // namespace WebCore
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebCore/platform/graphics/ImageBuffer.cpp
^
|
@@ -98,7 +98,7 @@
genericConvertToLuminanceMask();
}
-#if USE(ACCELERATED_COMPOSITING) && !USE(CAIRO) && !PLATFORM(BLACKBERRY)
+#if USE(ACCELERATED_COMPOSITING) && !USE(CAIRO) && !PLATFORM(BLACKBERRY) && !PLATFORM(QT)
PlatformLayer* ImageBuffer::platformLayer() const
{
return 0;
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebCore/platform/graphics/ImageBuffer.h
^
|
@@ -46,6 +46,12 @@
#include <wtf/Uint8ClampedArray.h>
#include <wtf/Vector.h>
+#if PLATFORM(QT)
+QT_BEGIN_NAMESPACE
+class QOpenGLContext;
+QT_END_NAMESPACE
+#endif
+
namespace WebCore {
class Image;
@@ -89,6 +95,9 @@
}
static PassOwnPtr<ImageBuffer> createCompatibleBuffer(const IntSize&, float resolutionScale, ColorSpace, const GraphicsContext*, bool hasAlpha);
+#if PLATFORM(QT)
+ static PassOwnPtr<ImageBuffer> createCompatibleBuffer(const IntSize&, float resolutionScale, ColorSpace, QOpenGLContext*);
+#endif
~ImageBuffer();
@@ -156,6 +165,9 @@
// This constructor will place its success into the given out-variable
// so that create() knows when it should return failure.
ImageBuffer(const IntSize&, float resolutionScale, ColorSpace, RenderingMode, bool& success);
+#if PLATFORM(QT)
+ ImageBuffer(const IntSize&, float resolutionScale, ColorSpace, QOpenGLContext*, bool& success);
+#endif
};
#if USE(CG)
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebCore/platform/graphics/NativeImagePtr.h
^
|
@@ -31,8 +31,6 @@
#if USE(CG)
typedef struct CGImage* CGImageRef;
#elif PLATFORM(QT)
-#include "NativeImageQt.h"
-#include <qglobal.h>
QT_BEGIN_NAMESPACE
class QPixmap;
QT_END_NAMESPACE
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebCore/platform/graphics/SimpleFontData.h
^
|
@@ -204,7 +204,7 @@
#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED > 1080
wkCTFontTransformOptions options = (typesettingFeatures & Kerning ? wkCTFontTransformApplyPositioning : 0) | (typesettingFeatures & Ligatures ? wkCTFontTransformApplyShaping : 0);
return wkCTFontTransformGlyphs(m_platformData.ctFont(), glyphs, reinterpret_cast<CGSize*>(advances), glyphCount, options);
-#elif PLATFORM(QT) && QT_VERSION >= 0x050100
+#elif PLATFORM(QT)
QRawFont::LayoutFlags flags = (typesettingFeatures & Kerning) ? QRawFont::KernedAdvances : QRawFont::SeparateAdvances;
return m_platformData.rawFont().advancesForGlyphIndexes(glyphs, advances, glyphCount, flags);
#else
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebCore/platform/graphics/WidthIterator.cpp
^
|
@@ -265,7 +265,7 @@
m_isAfterExpansion = false;
}
- if (shouldApplyFontTransforms() && glyphBuffer && Font::treatAsSpace(character))
+ if (shouldApplyFontTransforms() && glyphBuffer && (Font::treatAsSpace(character) || Font::treatAsZeroWidthSpace(character)))
charactersTreatedAsSpace.append(make_pair(glyphBuffer->size(),
OriginalAdvancesForCharacterTreatedAsSpace(character == ' ', glyphBuffer->size() ? glyphBuffer->advanceAt(glyphBuffer->size() - 1).width() : 0, width)));
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebCore/platform/graphics/WidthIterator.h
^
|
@@ -65,7 +65,7 @@
return !font.typesettingFeatures();
return !(font.typesettingFeatures() & ~(Kerning | Ligatures));
-#elif PLATFORM(QT) && QT_VERSION >= 0x050100
+#elif PLATFORM(QT)
return !(font.typesettingFeatures() & ~Kerning) && !font.isSmallCaps() && !font.letterSpacing();
#else
return !font.typesettingFeatures();
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp
^
|
@@ -51,7 +51,7 @@
#include <gst/interfaces/streamvolume.h>
#endif
-#if GST_CHECK_VERSION(1, 1, 0) && USE(ACCELERATED_COMPOSITING) && USE(TEXTURE_MAPPER_GL)
+#if GST_CHECK_VERSION(1, 1, 0) && USE(ACCELERATED_COMPOSITING) && USE(TEXTURE_MAPPER_GL) && !USE(COORDINATED_GRAPHICS)
#include "TextureMapperGL.h"
#endif
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp
^
|
@@ -30,44 +30,72 @@
#include "Extensions3DOpenGL.h"
#include "GraphicsContext3D.h"
+#include "NotImplemented.h"
#include <wtf/Vector.h>
#if PLATFORM(MAC)
#include "ANGLE/ShaderLang.h"
#include <OpenGL/gl.h>
-#elif PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(QT) || PLATFORM(WIN)
+#elif PLATFORM(QT)
+#include <private/qopenglextensions_p.h>
+#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0)
+#include <private/qopenglvertexarrayobject_p.h>
+#endif
+#elif PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(WIN)
#include "OpenGLShims.h"
#endif
+// Note this implementation serves a double role for Qt where it also handles OpenGLES.
+
namespace WebCore {
Extensions3DOpenGL::Extensions3DOpenGL(GraphicsContext3D* context)
: Extensions3DOpenGLCommon(context)
{
+#if PLATFORM(QT) && QT_VERSION >= QT_VERSION_CHECK(5, 4, 0)
+ context->makeContextCurrent();
+ m_vaoFunctions = new QOpenGLVertexArrayObjectHelper(context->platformGraphicsContext3D());
+#endif
}
Extensions3DOpenGL::~Extensions3DOpenGL()
{
+#if PLATFORM(QT) && QT_VERSION >= QT_VERSION_CHECK(5, 4, 0)
+ delete m_vaoFunctions;
+ m_vaoFunctions = 0;
+#endif
}
-
void Extensions3DOpenGL::blitFramebuffer(long srcX0, long srcY0, long srcX1, long srcY1, long dstX0, long dstY0, long dstX1, long dstY1, unsigned long mask, unsigned long filter)
{
+#if PLATFORM(QT)
+ m_context->m_functions->glBlitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
+#else
::glBlitFramebufferEXT(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
+#endif
}
void Extensions3DOpenGL::renderbufferStorageMultisample(unsigned long target, unsigned long samples, unsigned long internalformat, unsigned long width, unsigned long height)
{
+#if PLATFORM(QT)
+ m_context->m_functions->glRenderbufferStorageMultisample(target, samples, internalformat, width, height);
+#else
::glRenderbufferStorageMultisampleEXT(target, samples, internalformat, width, height);
+#endif
}
Platform3DObject Extensions3DOpenGL::createVertexArrayOES()
{
m_context->makeContextCurrent();
GLuint array = 0;
-#if (PLATFORM(GTK) || PLATFORM(QT) || PLATFORM(EFL)) || PLATFORM(WIN)
+#if (PLATFORM(GTK) || PLATFORM(EFL)) || PLATFORM(WIN)
if (isVertexArrayObjectSupported())
glGenVertexArrays(1, &array);
+#elif PLATFORM(QT)
+#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0)
+ if (isVertexArrayObjectSupported())
+ m_vaoFunctions->glGenVertexArrays(1, &array);
+#endif
#elif defined(GL_APPLE_vertex_array_object) && GL_APPLE_vertex_array_object
glGenVertexArraysAPPLE(1, &array);
#endif
@@ -80,9 +108,14 @@
return;
m_context->makeContextCurrent();
-#if (PLATFORM(GTK) || PLATFORM(QT) || PLATFORM(EFL) || PLATFORM(WIN))
+#if (PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(WIN))
if (isVertexArrayObjectSupported())
glDeleteVertexArrays(1, &array);
+#elif PLATFORM(QT)
+#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0)
+ if (isVertexArrayObjectSupported())
+ m_vaoFunctions->glDeleteVertexArrays(1, &array);
+#endif
#elif defined(GL_APPLE_vertex_array_object) && GL_APPLE_vertex_array_object
glDeleteVertexArraysAPPLE(1, &array);
#endif
@@ -94,21 +127,33 @@
return GL_FALSE;
m_context->makeContextCurrent();
-#if (PLATFORM(GTK) || PLATFORM(QT) || PLATFORM(EFL) || PLATFORM(WIN))
+#if (PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(WIN))
if (isVertexArrayObjectSupported())
return glIsVertexArray(array);
+#elif PLATFORM(QT)
+#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0)
+ if (isVertexArrayObjectSupported())
+ return m_vaoFunctions->glIsVertexArray(array);
+#endif
#elif defined(GL_APPLE_vertex_array_object) && GL_APPLE_vertex_array_object
return glIsVertexArrayAPPLE(array);
#endif
+
+ m_context->synthesizeGLError(GL_INVALID_OPERATION);
return GL_FALSE;
}
void Extensions3DOpenGL::bindVertexArrayOES(Platform3DObject array)
{
m_context->makeContextCurrent();
-#if (PLATFORM(GTK) || PLATFORM(QT) || PLATFORM(EFL) || PLATFORM(WIN))
+#if (PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(WIN))
if (isVertexArrayObjectSupported())
glBindVertexArray(array);
+#elif PLATFORM(QT)
+#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0)
+ if (isVertexArrayObjectSupported())
+ m_vaoFunctions->glBindVertexArray(array);
+#endif
#elif defined(GL_APPLE_vertex_array_object) && GL_APPLE_vertex_array_object
glBindVertexArrayAPPLE(array);
#else
@@ -144,39 +189,56 @@
{
// GL_ANGLE_framebuffer_blit and GL_ANGLE_framebuffer_multisample are "fake". They are implemented using other
// extensions. In particular GL_EXT_framebuffer_blit and GL_EXT_framebuffer_multisample
+#if PLATFORM(QT)
+ if (name == "GL_ANGLE_framebuffer_blit" || name == "GL_EXT_framebuffer_blit")
+ return m_context->m_functions->hasOpenGLExtension(QOpenGLExtensions::FramebufferBlit);
+ if (name == "GL_ANGLE_framebuffer_multisample" || name == "GL_EXT_framebuffer_multisample")
+ return m_context->m_functions->hasOpenGLExtension(QOpenGLExtensions::FramebufferMultisample);
+
+ if (name == "GL_OES_texture_npot" || name == "GL_ARB_texture_non_power_of_two")
+ return m_context->m_functions->hasOpenGLFeature(QOpenGLFunctions::NPOTTextures);
+ if (name == "GL_OES_packed_depth_stencil" || name == "GL_EXT_packed_depth_stencil")
+ return m_context->m_functions->hasOpenGLExtension(QOpenGLExtensions::PackedDepthStencil);
+
+ // FIXME: We don't have the robustness methods from Extensions3DOpenGLES.
+ if (name == "GL_EXT_robustness")
+ return false;
+#else
if (name == "GL_ANGLE_framebuffer_blit")
return m_availableExtensions.contains("GL_EXT_framebuffer_blit");
if (name == "GL_ANGLE_framebuffer_multisample")
return m_availableExtensions.contains("GL_EXT_framebuffer_multisample");
-
- // Desktop GL always supports GL_OES_rgb8_rgba8.
- if (name == "GL_OES_rgb8_rgba8")
- return true;
-
- // If GL_ARB_texture_float is available then we report GL_OES_texture_float and
- // GL_OES_texture_half_float as available.
- if (name == "GL_OES_texture_float" || name == "GL_OES_texture_half_float")
- return m_availableExtensions.contains("GL_ARB_texture_float");
+#endif
// GL_OES_vertex_array_object
if (name == "GL_OES_vertex_array_object") {
-#if (PLATFORM(GTK) || PLATFORM(QT) || PLATFORM(EFL))
+#if (PLATFORM(GTK) || PLATFORM(EFL))
return m_availableExtensions.contains("GL_ARB_vertex_array_object");
+#elif PLATFORM(QT)
+ return isVertexArrayObjectSupported();
#else
return m_availableExtensions.contains("GL_APPLE_vertex_array_object");
#endif
}
- // Desktop GL always supports the standard derivative functions
- if (name == "GL_OES_standard_derivatives")
- return true;
-
- // Desktop GL always supports UNSIGNED_INT indices
- if (name == "GL_OES_element_index_uint")
- return true;
-
- if (name == "GL_EXT_texture_filter_anisotropic")
- return m_availableExtensions.contains("GL_EXT_texture_filter_anisotropic");
+ if (!m_context->isGLES2Compliant()) {
+ // Desktop GL always supports GL_OES_rgb8_rgba8.
+ if (name == "GL_OES_rgb8_rgba8")
+ return true;
+
+ // If GL_ARB_texture_float is available then we report GL_OES_texture_float and
+ // GL_OES_texture_half_float as available.
+ if (name == "GL_OES_texture_float" || name == "GL_OES_texture_half_float")
+ return m_availableExtensions.contains("GL_ARB_texture_float");
+
+ // Desktop GL always supports the standard derivative functions
+ if (name == "GL_OES_standard_derivatives")
+ return true;
+
+ // Desktop GL always supports UNSIGNED_INT indices
+ if (name == "GL_OES_element_index_uint")
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.h
^
|
@@ -32,6 +32,12 @@
#include <wtf/HashSet.h>
#include <wtf/text/StringHash.h>
+#if PLATFORM(QT)
+QT_BEGIN_NAMESPACE
+class QOpenGLVertexArrayObjectHelper;
+QT_END_NAMESPACE
+#endif
+
namespace WebCore {
class Extensions3DOpenGL : public Extensions3DOpenGLCommon {
@@ -64,6 +70,10 @@
private:
bool isVertexArrayObjectSupported();
#endif
+
+#if PLATFORM(QT) && QT_VERSION >= QT_VERSION_CHECK(5, 4, 0)
+ QOpenGLVertexArrayObjectHelper *m_vaoFunctions;
+#endif
};
} // namespace WebCore
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.cpp
^
|
@@ -36,7 +36,9 @@
#include <BlackBerryPlatformLog.h>
#endif
-#if USE(OPENGL_ES_2)
+#if PLATFORM(QT)
+#include <private/qopenglextensions_p.h>
+#elif USE(OPENGL_ES_2)
#include "OpenGLESShims.h"
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
@@ -60,7 +62,7 @@
, m_maySupportMultisampling(true)
, m_requiresBuiltInFunctionEmulation(false)
{
- m_vendor = String(reinterpret_cast<const char*>(::glGetString(GL_VENDOR)));
+ m_vendor = String(reinterpret_cast<const char*>(m_context->m_functions->glGetString(GL_VENDOR)));
Vector<String> vendorComponents;
m_vendor.lower().split(' ', vendorComponents);
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLES.cpp
^
|
@@ -201,10 +201,9 @@
void Extensions3DOpenGLES::readnPixelsEXT(int x, int y, GC3Dsizei width, GC3Dsizei height, GC3Denum format, GC3Denum type, GC3Dsizei bufSize, void *data)
{
if (m_glReadnPixelsEXT) {
- m_context->makeContextCurrent();
// FIXME: remove the two glFlush calls when the driver bug is fixed, i.e.,
// all previous rendering calls should be done before reading pixels.
- ::glFlush();
+ m_context->flush();
// FIXME: If non-BlackBerry platforms use this, they will need to implement
// their anti-aliasing code here.
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp
^
|
@@ -1,6 +1,9 @@
/*
* Copyright (C) 2010 Apple Inc. All rights reserved.
* Copyright (C) 2011 Google Inc. All rights reserved.
+ * Copyright (C) 2012 ChangSeok Oh <shivamidow@gmail.com>
+ * Copyright (C) 2012 Research In Motion Limited. All rights reserved.
+ * Copyright (C) 2014 Digia Plc. and/or its subsidiary(-ies).
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -21,11 +24,13 @@
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
+// Note this implementation serves a double role for Qt where it also handles OpenGLES.
+
#if USE(3D_GRAPHICS)
#include "GraphicsContext3D.h"
@@ -35,85 +40,128 @@
#include "IntSize.h"
#include "NotImplemented.h"
-#include <algorithm>
-#include <cstring>
-#include <wtf/MainThread.h>
-#include <wtf/text/CString.h>
-
-#if PLATFORM(MAC)
-#include <OpenGL/gl.h>
-#elif PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(QT) || PLATFORM(WIN)
-#include "OpenGLShims.h"
+#include <QOpenGLContext>
+#include <private/qopenglextensions_p.h>
+
+#ifndef GL_BGRA
+#define GL_BGRA 0x80E1
+#endif
+
+#ifndef GL_READ_FRAMEBUFFER
+#define GL_READ_FRAMEBUFFER 0x8CA8
+#endif
+
+#ifndef GL_DRAW_FRAMEBUFFER
+#define GL_DRAW_FRAMEBUFFER 0x8CA9
+#endif
+
+#ifndef GL_MAX_VARYING_FLOATS
+#define GL_MAX_VARYING_FLOATS 0x8B4B
+#endif
+
+#ifndef GL_ALPHA16F_ARB
+#define GL_ALPHA16F_ARB 0x881C
+#endif
+
+#ifndef GL_LUMINANCE16F_ARB
+#define GL_LUMINANCE16F_ARB 0x881E
+#endif
+
+#ifndef GL_LUMINANCE_ALPHA16F_ARB
+#define GL_LUMINANCE_ALPHA16F_ARB 0x881F
+#endif
+
+#ifndef GL_HALF_FLOAT_OES
+#define GL_HALF_FLOAT_OES 0x8D61
#endif
namespace WebCore {
void GraphicsContext3D::releaseShaderCompiler()
{
+ ASSERT(m_private);
makeContextCurrent();
- notImplemented();
+ m_functions->glReleaseShaderCompiler();
}
void GraphicsContext3D::readPixelsAndConvertToBGRAIfNecessary(int x, int y, int width, int height, unsigned char* pixels)
{
- ::glReadPixels(x, y, width, height, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, pixels);
+ ASSERT(m_private);
+ bool readBGRA = !isGLES2Compliant() || platformGraphicsContext3D()->hasExtension("GL_EXT_read_format_bgra");
+
+ if (readBGRA)
+ m_functions->glReadPixels(x, y, width, height, GL_BGRA, GL_UNSIGNED_BYTE, pixels);
+ else
+ m_functions->glReadPixels(x, y, width, height, GL_RGBA, GL_UNSIGNED_BYTE, pixels);
+ int totalBytes = width * height * 4;
+ if (!readBGRA) {
+ for (int i = 0; i < totalBytes; i += 4)
+ std::swap(pixels[i], pixels[i + 2]); // Convert to BGRA.
+ }
}
void GraphicsContext3D::validateAttributes()
{
- validateDepthStencil("GL_EXT_packed_depth_stencil");
+ if (isGLES2Compliant())
+ validateDepthStencil("GL_OES_packed_depth_stencil");
+ else
+ validateDepthStencil("GL_EXT_packed_depth_stencil");
+
+ if (m_attrs.antialias && isGLES2Compliant()) {
+ if (!m_functions->hasOpenGLExtension(QOpenGLExtensions::FramebufferMultisample) || !m_functions->hasOpenGLExtension(QOpenGLExtensions::FramebufferBlit))
+ m_attrs.antialias = false;
+ }
}
bool GraphicsContext3D::reshapeFBOs(const IntSize& size)
{
const int width = size.width();
const int height = size.height();
- GLuint colorFormat, internalDepthStencilFormat = 0;
+ GLuint colorFormat = 0, pixelDataType = 0;
if (m_attrs.alpha) {
- m_internalColorFormat = GL_RGBA8;
+ m_internalColorFormat = isGLES2Compliant() ? GL_RGBA : GL_RGBA8;
colorFormat = GL_RGBA;
+ pixelDataType = GL_UNSIGNED_BYTE;
} else {
- m_internalColorFormat = GL_RGB8;
+ m_internalColorFormat = isGLES2Compliant() ? GL_RGB : GL_RGB8;
colorFormat = GL_RGB;
+ pixelDataType = isGLES2Compliant() ? GL_UNSIGNED_SHORT_5_6_5 : GL_UNSIGNED_BYTE;
}
- if (m_attrs.stencil || m_attrs.depth) {
- // We don't allow the logic where stencil is required and depth is not.
- // See GraphicsContext3D::validateAttributes.
- Extensions3D* extensions = getExtensions();
- // Use a 24 bit depth buffer where we know we have it.
- if (extensions->supports("GL_EXT_packed_depth_stencil"))
- internalDepthStencilFormat = GL_DEPTH24_STENCIL8_EXT;
- else
- internalDepthStencilFormat = GL_DEPTH_COMPONENT;
- }
+ // We don't allow the logic where stencil is required and depth is not.
+ bool supportPackedDepthStencilBuffer = false;
+ if (m_attrs.stencil || m_attrs.depth)
+ supportPackedDepthStencilBuffer = m_functions->hasOpenGLExtension(QOpenGLExtensions::PackedDepthStencil);
bool mustRestoreFBO = false;
// Resize multisample FBO.
- if (m_attrs.antialias) {
+ if (m_attrs.antialias && !isGLES2Compliant()) {
GLint maxSampleCount;
- ::glGetIntegerv(GL_MAX_SAMPLES_EXT, &maxSampleCount);
+ m_functions->glGetIntegerv(GL_MAX_SAMPLES, &maxSampleCount);
GLint sampleCount = std::min(8, maxSampleCount);
if (sampleCount > maxSampleCount)
sampleCount = maxSampleCount;
if (m_state.boundFBO != m_multisampleFBO) {
- ::glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_multisampleFBO);
+ m_functions->glBindFramebuffer(GL_FRAMEBUFFER, m_multisampleFBO);
mustRestoreFBO = true;
}
- ::glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, m_multisampleColorBuffer);
- ::glRenderbufferStorageMultisampleEXT(GL_RENDERBUFFER_EXT, sampleCount, m_internalColorFormat, width, height);
- ::glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_RENDERBUFFER_EXT, m_multisampleColorBuffer);
+ m_functions->glBindRenderbuffer(GL_RENDERBUFFER, m_multisampleColorBuffer);
+ m_functions->glRenderbufferStorageMultisample(GL_RENDERBUFFER, sampleCount, m_internalColorFormat, width, height);
+ m_functions->glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, m_multisampleColorBuffer);
if (m_attrs.stencil || m_attrs.depth) {
- ::glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, m_multisampleDepthStencilBuffer);
- ::glRenderbufferStorageMultisampleEXT(GL_RENDERBUFFER_EXT, sampleCount, internalDepthStencilFormat, width, height);
+ m_functions->glBindRenderbuffer(GL_RENDERBUFFER, m_multisampleDepthStencilBuffer);
+ if (supportPackedDepthStencilBuffer)
+ m_functions->glRenderbufferStorageMultisample(GL_RENDERBUFFER, sampleCount, GL_DEPTH24_STENCIL8, width, height);
+ else
+ m_functions->glRenderbufferStorageMultisample(GL_RENDERBUFFER, sampleCount, GL_DEPTH_COMPONENT, width, height);
if (m_attrs.stencil)
- ::glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_STENCIL_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, m_multisampleDepthStencilBuffer);
+ m_functions->glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, m_multisampleDepthStencilBuffer);
if (m_attrs.depth)
- ::glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, m_multisampleDepthStencilBuffer);
+ m_functions->glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, m_multisampleDepthStencilBuffer);
}
- ::glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, 0);
- if (glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT) != GL_FRAMEBUFFER_COMPLETE_EXT) {
+ m_functions->glBindRenderbuffer(GL_RENDERBUFFER, 0);
+ if (m_functions->glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE) {
// FIXME: cleanup.
notImplemented();
}
@@ -122,30 +170,52 @@
// resize regular FBO
if (m_state.boundFBO != m_fbo) {
mustRestoreFBO = true;
- ::glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_fbo);
+ m_functions->glBindFramebuffer(GL_FRAMEBUFFER, m_fbo);
}
- ::glBindTexture(GL_TEXTURE_2D, m_texture);
- ::glTexImage2D(GL_TEXTURE_2D, 0, m_internalColorFormat, width, height, 0, colorFormat, GL_UNSIGNED_BYTE, 0);
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp
^
|
@@ -53,11 +53,13 @@
#include <wtf/Uint8Array.h>
#include <wtf/text/CString.h>
-#if USE(OPENGL_ES_2)
+#if PLATFORM(QT)
+#include <private/qopenglextensions_p.h>
+#elif USE(OPENGL_ES_2)
#include "OpenGLESShims.h"
#elif PLATFORM(MAC)
#include <OpenGL/gl.h>
-#elif PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(QT) || PLATFORM(WIN)
+#elif PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(WIN)
#include "OpenGLShims.h"
#endif
@@ -162,15 +164,15 @@
if (m_attrs.antialias)
resolveMultisamplingIfNecessary();
- ::glBindFramebufferEXT(GraphicsContext3D::FRAMEBUFFER, m_fbo);
- ::glActiveTexture(GL_TEXTURE0);
- ::glBindTexture(GL_TEXTURE_2D, m_compositorTexture);
- ::glCopyTexImage2D(GL_TEXTURE_2D, 0, m_internalColorFormat, 0, 0, m_currentWidth, m_currentHeight, 0);
- ::glBindTexture(GL_TEXTURE_2D, m_state.boundTexture0);
- ::glActiveTexture(m_state.activeTexture);
+ m_functions->glBindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_fbo);
+ m_functions->glActiveTexture(GL_TEXTURE0);
+ m_functions->glBindTexture(GL_TEXTURE_2D, m_compositorTexture);
+ m_functions->glCopyTexImage2D(GL_TEXTURE_2D, 0, m_internalColorFormat, 0, 0, m_currentWidth, m_currentHeight, 0);
+ m_functions->glBindTexture(GL_TEXTURE_2D, m_state.boundTexture0);
+ m_functions->glActiveTexture(m_state.activeTexture);
if (m_state.boundFBO != m_fbo)
- ::glBindFramebufferEXT(GraphicsContext3D::FRAMEBUFFER, m_state.boundFBO);
- ::glFinish();
+ m_functions->glBindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_state.boundFBO);
+ m_functions->glFinish();
m_layerComposited = true;
}
#endif
@@ -185,30 +187,30 @@
bool mustRestoreFBO = false;
if (m_attrs.antialias) {
resolveMultisamplingIfNecessary();
- ::glBindFramebufferEXT(GraphicsContext3D::FRAMEBUFFER, m_fbo);
+ m_functions->glBindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_fbo);
mustRestoreFBO = true;
} else {
if (m_state.boundFBO != m_fbo) {
mustRestoreFBO = true;
- ::glBindFramebufferEXT(GraphicsContext3D::FRAMEBUFFER, m_fbo);
+ m_functions->glBindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_fbo);
}
}
GLint packAlignment = 4;
bool mustRestorePackAlignment = false;
- ::glGetIntegerv(GL_PACK_ALIGNMENT, &packAlignment);
+ m_functions->glGetIntegerv(GL_PACK_ALIGNMENT, &packAlignment);
if (packAlignment > 4) {
- ::glPixelStorei(GL_PACK_ALIGNMENT, 4);
+ m_functions->glPixelStorei(GL_PACK_ALIGNMENT, 4);
mustRestorePackAlignment = true;
}
readPixelsAndConvertToBGRAIfNecessary(0, 0, m_currentWidth, m_currentHeight, pixels);
if (mustRestorePackAlignment)
- ::glPixelStorei(GL_PACK_ALIGNMENT, packAlignment);
+ m_functions->glPixelStorei(GL_PACK_ALIGNMENT, packAlignment);
if (mustRestoreFBO)
- ::glBindFramebufferEXT(GraphicsContext3D::FRAMEBUFFER, m_state.boundFBO);
+ m_functions->glBindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_state.boundFBO);
}
void GraphicsContext3D::reshape(int width, int height)
@@ -220,7 +222,7 @@
return;
#if (PLATFORM(QT) || PLATFORM(EFL)) && USE(GRAPHICS_SURFACE)
- ::glFlush(); // Make sure all GL calls have been committed before resizing.
+ m_functions->glFlush(); // Make sure all GL calls have been committed before resizing.
createGraphicsSurfaces(IntSize(width, height));
#endif
@@ -240,54 +242,54 @@
GLboolean isScissorEnabled = GL_FALSE;
GLboolean isDitherEnabled = GL_FALSE;
GLbitfield clearMask = GL_COLOR_BUFFER_BIT;
- ::glGetFloatv(GL_COLOR_CLEAR_VALUE, clearColor);
- ::glClearColor(0, 0, 0, 0);
- ::glGetBooleanv(GL_COLOR_WRITEMASK, colorMask);
- ::glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
+ m_functions->glGetFloatv(GL_COLOR_CLEAR_VALUE, clearColor);
+ m_functions->glClearColor(0, 0, 0, 0);
+ m_functions->glGetBooleanv(GL_COLOR_WRITEMASK, colorMask);
+ m_functions->glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
if (m_attrs.depth) {
- ::glGetFloatv(GL_DEPTH_CLEAR_VALUE, &clearDepth);
+ m_functions->glGetFloatv(GL_DEPTH_CLEAR_VALUE, &clearDepth);
GraphicsContext3D::clearDepth(1);
- ::glGetBooleanv(GL_DEPTH_WRITEMASK, &depthMask);
- ::glDepthMask(GL_TRUE);
+ m_functions->glGetBooleanv(GL_DEPTH_WRITEMASK, &depthMask);
+ m_functions->glDepthMask(GL_TRUE);
clearMask |= GL_DEPTH_BUFFER_BIT;
}
if (m_attrs.stencil) {
- ::glGetIntegerv(GL_STENCIL_CLEAR_VALUE, &clearStencil);
- ::glClearStencil(0);
- ::glGetIntegerv(GL_STENCIL_WRITEMASK, reinterpret_cast<GLint*>(&stencilMask));
- ::glStencilMaskSeparate(GL_FRONT, 0xffffffff);
+ m_functions->glGetIntegerv(GL_STENCIL_CLEAR_VALUE, &clearStencil);
+ m_functions->glClearStencil(0);
+ m_functions->glGetIntegerv(GL_STENCIL_WRITEMASK, reinterpret_cast<GLint*>(&stencilMask));
+ m_functions->glStencilMaskSeparate(GL_FRONT, 0xffffffff);
clearMask |= GL_STENCIL_BUFFER_BIT;
}
- isScissorEnabled = ::glIsEnabled(GL_SCISSOR_TEST);
- ::glDisable(GL_SCISSOR_TEST);
- isDitherEnabled = ::glIsEnabled(GL_DITHER);
- ::glDisable(GL_DITHER);
+ isScissorEnabled = m_functions->glIsEnabled(GL_SCISSOR_TEST);
+ m_functions->glDisable(GL_SCISSOR_TEST);
+ isDitherEnabled = m_functions->glIsEnabled(GL_DITHER);
+ m_functions->glDisable(GL_DITHER);
- ::glClear(clearMask);
+ m_functions->glClear(clearMask);
- ::glClearColor(clearColor[0], clearColor[1], clearColor[2], clearColor[3]);
- ::glColorMask(colorMask[0], colorMask[1], colorMask[2], colorMask[3]);
+ m_functions->glClearColor(clearColor[0], clearColor[1], clearColor[2], clearColor[3]);
+ m_functions->glColorMask(colorMask[0], colorMask[1], colorMask[2], colorMask[3]);
if (m_attrs.depth) {
GraphicsContext3D::clearDepth(clearDepth);
- ::glDepthMask(depthMask);
+ m_functions->glDepthMask(depthMask);
}
if (m_attrs.stencil) {
- ::glClearStencil(clearStencil);
- ::glStencilMaskSeparate(GL_FRONT, stencilMask);
+ m_functions->glClearStencil(clearStencil);
+ m_functions->glStencilMaskSeparate(GL_FRONT, stencilMask);
}
if (isScissorEnabled)
- ::glEnable(GL_SCISSOR_TEST);
+ m_functions->glEnable(GL_SCISSOR_TEST);
else
- ::glDisable(GL_SCISSOR_TEST);
+ m_functions->glDisable(GL_SCISSOR_TEST);
if (isDitherEnabled)
- ::glEnable(GL_DITHER);
+ m_functions->glEnable(GL_DITHER);
else
- ::glDisable(GL_DITHER);
+ m_functions->glDisable(GL_DITHER);
if (mustRestoreFBO)
- ::glBindFramebufferEXT(GraphicsContext3D::FRAMEBUFFER, m_state.boundFBO);
+ m_functions->glBindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_state.boundFBO);
- ::glFlush();
+ m_functions->glFlush();
}
IntSize GraphicsContext3D::getInternalFramebufferSize() const
@@ -299,7 +301,7 @@
{
makeContextCurrent();
m_state.activeTexture = texture;
- ::glActiveTexture(texture);
+ m_functions->glActiveTexture(texture);
}
void GraphicsContext3D::attachShader(Platform3DObject program, Platform3DObject shader)
@@ -307,20 +309,20 @@
ASSERT(program);
ASSERT(shader);
makeContextCurrent();
- ::glAttachShader(program, shader);
+ m_functions->glAttachShader(program, shader);
}
void GraphicsContext3D::bindAttribLocation(Platform3DObject program, GC3Duint index, const String& name)
{
ASSERT(program);
makeContextCurrent();
- ::glBindAttribLocation(program, index, name.utf8().data());
+ m_functions->glBindAttribLocation(program, index, name.utf8().data());
}
void GraphicsContext3D::bindBuffer(GC3Denum target, Platform3DObject buffer)
{
makeContextCurrent();
- ::glBindBuffer(target, buffer);
+ m_functions->glBindBuffer(target, buffer);
}
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebCore/platform/graphics/qt/FontPlatformDataQt.cpp
^
|
@@ -74,9 +74,22 @@
font.setWeight(toQFontWeight(description.weight()));
font.setWordSpacing(wordSpacing);
font.setLetterSpacing(QFont::AbsoluteSpacing, letterSpacing);
- if (description.fontSmoothing() == NoSmoothing
- || (description.fontSmoothing() == AutoSmoothing && !Font::shouldUseSmoothing()))
- font.setStyleStrategy(QFont::NoAntialias);
+ switch (description.fontSmoothing()) {
+ case AutoSmoothing:
+ if (Font::shouldUseSmoothing())
+ break;
+ // no break
+ case NoSmoothing:
+ font.setStyleStrategy(QFont::NoAntialias);
+ break;
+ case Antialiased:
+#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0)
+ font.setStyleStrategy(QFont::NoSubpixelAntialias);
+ break;
+#endif
+ case SubpixelAntialiased:
+ break;
+ }
m_data->bold = font.bold();
// WebKit allows font size zero but QFont does not. We will return
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebCore/platform/graphics/qt/FontQt.cpp
^
|
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies)
+ Copyright (C) 2012, 2014 Digia Plc. and/or its subsidiary(-ies)
Copyright (C) 2008, 2010 Holger Hans Peter Freyther
Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
@@ -31,6 +31,8 @@
#include "GraphicsContext.h"
#include "NotImplemented.h"
#include "Pattern.h"
+#include "RenderBlock.h"
+#include "RenderText.h"
#include "ShadowBlur.h"
#include "TextRun.h"
@@ -57,11 +59,14 @@
return QString::fromRawData(reinterpret_cast<const QChar*>(string.characters() + start), len);
}
-static QTextLine setupLayout(QTextLayout* layout, const TextRun& style)
+static QTextLine setupLayout(QTextLayout* layout, const TextRun& style, bool shouldSetDirection)
{
- int flags = style.rtl() ? Qt::TextForceRightToLeft : Qt::TextForceLeftToRight;
+ int flags = 0;
+ if (shouldSetDirection || style.directionalOverride())
+ flags |= style.rtl() ? Qt::TextForceRightToLeft : Qt::TextForceLeftToRight;
if (style.expansion())
flags |= Qt::TextJustificationForced;
+ layout->setCacheEnabled(true);
layout->setFlags(flags);
layout->beginLayout();
QTextLine line = layout->createLine();
@@ -168,6 +173,67 @@
}
}
+class TextLayout {
+public:
+ static bool isNeeded(RenderText* text, const Font& font)
+ {
+ TextRun run = RenderBlock::constructTextRun(text, font, text, text->style());
+ return font.codePath(run) == Font::Complex;
+ }
+
+ TextLayout(RenderText* text, const Font& font, float xPos)
+ {
+ const TextRun run(constructTextRun(text, font, xPos));
+ const String sanitized = Font::normalizeSpaces(run.characters16(), run.length());
+ const QString string(sanitized);
+ m_layout.setText(string);
+ m_layout.setRawFont(font.rawFont());
+ font.initFormatForTextLayout(&m_layout, run);
+ m_line = setupLayout(&m_layout, run, false);
+ }
+
+ float width(unsigned from, unsigned len, HashSet<const SimpleFontData*>* fallbackFonts)
+ {
+ Q_UNUSED(fallbackFonts);
+ float x1 = m_line.cursorToX(from);
+ float x2 = m_line.cursorToX(from + len);
+ float width = qAbs(x2 - x1);
+
+ return width;
+ }
+
+private:
+ static TextRun constructTextRun(RenderText* text, const Font& font, float xPos)
+ {
+ TextRun run = RenderBlock::constructTextRun(text, font, text, text->style());
+ run.setCharactersLength(text->textLength());
+ ASSERT(run.charactersLength() >= run.length());
+
+ run.setXPos(xPos);
+ return run;
+ }
+
+ QTextLayout m_layout;
+ QTextLine m_line;
+};
+
+PassOwnPtr<TextLayout> Font::createLayout(RenderText* text, float xPos, bool collapseWhiteSpace) const
+{
+ if (!collapseWhiteSpace || !TextLayout::isNeeded(text, *this))
+ return PassOwnPtr<TextLayout>();
+ return adoptPtr(new TextLayout(text, *this, xPos));
+}
+
+void Font::deleteLayout(TextLayout* layout)
+{
+ delete layout;
+}
+
+float Font::width(TextLayout& layout, unsigned from, unsigned len, HashSet<const SimpleFontData*>* fallbackFonts)
+{
+ return layout.width(from, len, fallbackFonts);
+}
+
void Font::drawComplexText(GraphicsContext* ctx, const TextRun& run, const FloatPoint& point, int from, int to) const
{
String sanitized = Font::normalizeSpaces(run.characters16(), run.length());
@@ -175,7 +241,7 @@
QTextLayout layout(string);
layout.setRawFont(rawFont());
initFormatForTextLayout(&layout, run);
- QTextLine line = setupLayout(&layout, run);
+ QTextLine line = setupLayout(&layout, run, true);
const QPointF adjustedPoint(point.x(), point.y() - line.ascent());
QList<QGlyphRun> runs = line.glyphRuns(from, to - from);
@@ -199,7 +265,7 @@
QTextLayout layout(string);
layout.setRawFont(rawFont());
initFormatForTextLayout(&layout, run);
- QTextLine line = setupLayout(&layout, run);
+ QTextLine line = setupLayout(&layout, run, false);
float x1 = line.cursorToX(0);
float x2 = line.cursorToX(run.length());
float width = qAbs(x2 - x1);
@@ -215,7 +281,7 @@
QTextLayout layout(string);
layout.setRawFont(rawFont());
initFormatForTextLayout(&layout, run);
- QTextLine line = setupLayout(&layout, run);
+ QTextLine line = setupLayout(&layout, run, false);
return line.xToCursor(position);
}
@@ -227,7 +293,7 @@
QTextLayout layout(string);
layout.setRawFont(rawFont());
initFormatForTextLayout(&layout, run);
- QTextLine line = setupLayout(&layout, run);
+ QTextLine line = setupLayout(&layout, run, false);
float x1 = line.cursorToX(from);
float x2 = line.cursorToX(to);
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp
^
|
@@ -19,11 +19,7 @@
#include "config.h"
#include "GraphicsContext3D.h"
-#if USE(OPENGL_ES_2)
-#include "Extensions3DOpenGLES.h"
-#else
-#include "Extensions3DOpenGL.h"
-#endif
+#include "Extensions3DOpenGLCommon.h"
#include "GraphicsContext.h"
#include "GraphicsSurface.h"
#include "HostWindow.h"
@@ -31,18 +27,14 @@
#include "ImageData.h"
#include "NativeImageQt.h"
#include "NotImplemented.h"
-#include "OpenGLShims.h"
#include "QWebPageClient.h"
#include "SharedBuffer.h"
#include "TextureMapperPlatformLayer.h"
#include <qpa/qplatformpixmap.h>
#include <wtf/text/CString.h>
-#if QT_VERSION >= 0x050100
+#include <private/qopenglextensions_p.h>
#include <QOffscreenSurface>
-#else
-#include <QWindow>
-#endif
#if USE(TEXTURE_MAPPER_GL)
#include <texmap/TextureMapperGL.h>
@@ -50,20 +42,41 @@
#if USE(3D_GRAPHICS)
+QT_BEGIN_NAMESPACE
+extern Q_GUI_EXPORT QImage qt_gl_read_framebuffer(const QSize &size, bool alpha_format, bool include_alpha);
+QT_END_NAMESPACE
+
namespace WebCore {
#if !defined(GLchar)
typedef char GLchar;
#endif
-#if !defined(GL_DEPTH24_STENCIL8)
-#define GL_DEPTH24_STENCIL8 0x88F0
+#ifndef GL_VERTEX_PROGRAM_POINT_SIZE
+#define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642
+#endif
+
+#ifndef GL_POINT_SPRITE
+#define GL_POINT_SPRITE 0x8861
+#endif
+
+#ifndef GL_DEPTH24_STENCIL8
+#define GL_DEPTH24_STENCIL8 0x88F0
+#endif
+
+#ifndef GL_READ_FRAMEBUFFER
+#define GL_READ_FRAMEBUFFER 0x8CA8
+#endif
+
+#ifndef GL_DRAW_FRAMEBUFFER
+#define GL_DRAW_FRAMEBUFFER 0x8CA9
#endif
class GraphicsContext3DPrivate
#if USE(ACCELERATED_COMPOSITING)
: public TextureMapperPlatformLayer
#endif
+ , public QOpenGLExtensions
{
public:
GraphicsContext3DPrivate(GraphicsContext3D*, HostWindow*, GraphicsContext3D::RenderStyle);
@@ -79,13 +92,15 @@
#endif
QRectF boundingRect() const;
- void blitMultisampleFramebuffer() const;
- void blitMultisampleFramebufferAndRestoreContext() const;
+ void blitMultisampleFramebuffer();
+ void blitMultisampleFramebufferAndRestoreContext();
bool makeCurrentIfNeeded() const;
void createOffscreenBuffers();
void initializeANGLE();
void createGraphicsSurfaces(const IntSize&);
+ bool isOpenGLES() const;
+
GraphicsContext3D* m_context;
HostWindow* m_hostWindow;
PlatformGraphicsSurface3D m_surface;
@@ -97,8 +112,22 @@
#endif
};
+bool GraphicsContext3DPrivate::isOpenGLES() const
+{
+ if (m_platformContext)
+ return m_platformContext->isOpenGLES();
+#if USE(OPENGL_ES_2)
+ return true;
+#else
+ return false;
+#endif
+}
+
bool GraphicsContext3D::isGLES2Compliant() const
{
+ if (m_private)
+ return m_private->isOpenGLES();
+ ASSERT_NOT_REACHED();
#if USE(OPENGL_ES_2)
return true;
#else
@@ -117,36 +146,32 @@
m_platformContext = QOpenGLContext::currentContext();
if (m_platformContext)
m_surface = m_platformContext->surface();
+ initializeOpenGLFunctions();
return;
}
QOpenGLContext* shareContext = 0;
- if (hostWindow && hostWindow->platformPageClient() && hostWindow->platformPageClient()->makeOpenGLContextCurrentIfAvailable())
- shareContext = QOpenGLContext::currentContext();
+ if (hostWindow && hostWindow->platformPageClient())
+ shareContext = hostWindow->platformPageClient()->openGLContextIfAvailable();
-#if QT_VERSION >= 0x050100
QOffscreenSurface* surface = new QOffscreenSurface;
surface->create();
m_surface = surface;
m_surfaceOwner = surface;
-#else
- QWindow* window = new QWindow;
- window->setSurfaceType(QSurface::OpenGLSurface);
- window->setGeometry(-10, -10, 1, 1);
- window->create();
- m_surface = window;
- m_surfaceOwner = window;
-#endif
m_platformContext = new QOpenGLContext(m_surfaceOwner);
if (shareContext)
m_platformContext->setShareContext(shareContext);
- if (!m_platformContext->create())
+ if (!m_platformContext->create()) {
+ delete m_platformContext;
+ m_platformContext = 0;
return;
+ }
makeCurrentIfNeeded();
+ initializeOpenGLFunctions();
#if USE(GRAPHICS_SURFACE)
IntSize surfaceSize(m_context->m_currentWidth, m_context->m_currentHeight);
m_surfaceFlags = GraphicsSurface::SupportsTextureTarget
@@ -162,31 +187,31 @@
glGenFramebuffers(/* count */ 1, &m_context->m_fbo);
glGenTextures(1, &m_context->m_texture);
- glBindTexture(GraphicsContext3D::TEXTURE_2D, m_context->m_texture);
- glTexParameterf(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_MAG_FILTER, GraphicsContext3D::LINEAR);
- glTexParameterf(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_MIN_FILTER, GraphicsContext3D::LINEAR);
- glTexParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_WRAP_S, GraphicsContext3D::CLAMP_TO_EDGE);
- glTexParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_WRAP_T, GraphicsContext3D::CLAMP_TO_EDGE);
- glBindTexture(GraphicsContext3D::TEXTURE_2D, 0);
+ glBindTexture(GL_TEXTURE_2D, m_context->m_texture);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+ glBindTexture(GL_TEXTURE_2D, 0);
// Create a multisample FBO.
if (m_context->m_attrs.antialias) {
glGenFramebuffers(1, &m_context->m_multisampleFBO);
- glBindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_context->m_multisampleFBO);
+ glBindFramebuffer(GL_FRAMEBUFFER, m_context->m_multisampleFBO);
m_context->m_state.boundFBO = m_context->m_multisampleFBO;
glGenRenderbuffers(1, &m_context->m_multisampleColorBuffer);
if (m_context->m_attrs.stencil || m_context->m_attrs.depth)
glGenRenderbuffers(1, &m_context->m_multisampleDepthStencilBuffer);
} else {
// Bind canvas FBO.
- glBindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_context->m_fbo);
+ glBindFramebuffer(GL_FRAMEBUFFER, m_context->m_fbo);
m_context->m_state.boundFBO = m_context->m_fbo;
-#if USE(OPENGL_ES_2)
- if (m_context->m_attrs.depth)
- glGenRenderbuffers(1, &m_context->m_depthBuffer);
- if (m_context->m_attrs.stencil)
- glGenRenderbuffers(1, &m_context->m_stencilBuffer);
-#endif
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
^
|
@@ -660,6 +660,9 @@
if (paintingDisabled())
return;
+ if (!(m_state.fillPattern || m_state.fillGradient || m_state.fillColor.isValid()))
+ return;
+
QPainter* p = m_data->p();
QPainterPath platformPath = path.platformPath();
platformPath.setFillRule(toQtFillRule(fillRule()));
@@ -824,6 +827,9 @@
if (paintingDisabled())
return;
+ if (!(m_state.fillPattern || m_state.fillGradient || m_state.fillColor.isValid()))
+ return;
+
QPainter* p = m_data->p();
QRectF normalizedRect = rect.normalized();
@@ -1725,6 +1731,10 @@
m_data->takeOwnershipOfPlatformContext();
}
+bool GraphicsContext::isAcceleratedContext() const
+{
+ return (platformContext()->paintEngine()->type() == QPaintEngine::OpenGL2);
}
+}
// vim: ts=4 sw=4 et
|
[-]
[+]
|
Added |
qtwebkit-5.4.1.tar.xz/Source/WebCore/platform/graphics/qt/ImageBufferDataQt.cpp
^
|
@@ -0,0 +1,534 @@
+/*
+ * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org>
+ * Copyright (C) 2008 Holger Hans Peter Freyther
+ * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
+ * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved.
+ * Copyright (C) 2014 Digia Plc. and/or its subsidiary(-ies)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "ImageBuffer.h"
+
+#include "GraphicsContext.h"
+#include "GraphicsSurface.h"
+#include "ImageData.h"
+#include "StillImageQt.h"
+#include "QFramebufferPaintDevice.h"
+
+#include <QImage>
+#include <QPaintEngine>
+#include <QPainter>
+#include <QPixmap>
+
+#if ENABLE(ACCELERATED_2D_CANVAS)
+#include "TextureMapper.h"
+#include "TextureMapperPlatformLayer.h"
+#include "TextureMapperGL.h"
+#include <QOffscreenSurface>
+#include <QOpenGLContext>
+#include <QOpenGLFramebufferObject>
+#include <QOpenGLPaintDevice>
+#include <QThreadStorage>
+#include <private/qopenglpaintengine_p.h>
+#endif
+
+namespace WebCore {
+
+#if ENABLE(ACCELERATED_2D_CANVAS)
+
+class QOpenGLContextThreadStorage
+{
+public:
+ QOpenGLContext *context() {
+ QOpenGLContext *&context = storage.localData();
+ if (!context) {
+ context = new QOpenGLContext;
+ context->create();
+ }
+ return context;
+ }
+
+private:
+ QThreadStorage<QOpenGLContext *> storage;
+};
+
+Q_GLOBAL_STATIC(QOpenGLContextThreadStorage, imagebuffer_opengl_context)
+
+// The owner of the surface needs to be separate from QFramebufferPaintDevice, since the surface
+// must already be current with the QFramebufferObject constructor is called.
+class ImageBufferContext {
+public:
+ ImageBufferContext(QOpenGLContext* sharedContext)
+ : m_ownSurface(0)
+ {
+ if (sharedContext)
+ m_format = sharedContext->format();
+
+ m_context = sharedContext ? sharedContext : imagebuffer_opengl_context->context();
+
+ m_surface = m_context->surface();
+ }
+ ~ImageBufferContext()
+ {
+ if (QOpenGLContext::currentContext() == m_context && m_context->surface() == m_ownSurface)
+ m_context->doneCurrent();
+ delete m_ownSurface;
+ }
+ void createSurfaceIfNeeded()
+ {
+ if (m_surface)
+ return;
+
+ m_ownSurface = new QOffscreenSurface;
+ m_ownSurface->setFormat(m_format);
+ m_ownSurface->create();
+
+ m_surface = m_ownSurface;
+ }
+ void makeCurrentIfNeeded()
+ {
+ if (QOpenGLContext::currentContext() != m_context) {
+ createSurfaceIfNeeded();
+
+ m_context->makeCurrent(m_surface);
+ }
+ }
+ QOpenGLContext* context() { return m_context; }
+
+private:
+ QSurface *m_surface;
+ QOffscreenSurface *m_ownSurface;
+ QOpenGLContext *m_context;
+ QSurfaceFormat m_format;
+};
+
+// ---------------------- ImageBufferDataPrivateAccelerated
+
+struct ImageBufferDataPrivateAccelerated : public TextureMapperPlatformLayer, public ImageBufferDataPrivate {
+ ImageBufferDataPrivateAccelerated(const IntSize& size, QOpenGLContext* sharedContext);
+ virtual ~ImageBufferDataPrivateAccelerated();
+
+ virtual QPaintDevice* paintDevice() OVERRIDE { return m_paintDevice; }
+ virtual QImage toQImage() const OVERRIDE;
+ virtual PassRefPtr<Image> image() const OVERRIDE;
+ virtual PassRefPtr<Image> copyImage() const OVERRIDE;
+ virtual bool isAccelerated() const OVERRIDE { return true; }
+ virtual PlatformLayer* platformLayer() OVERRIDE { return this; }
+
+ void invalidateState() const;
+ virtual void draw(GraphicsContext* destContext, ColorSpace styleColorSpace, const FloatRect& destRect,
+ const FloatRect& srcRect, CompositeOperator op, BlendMode blendMode, bool useLowQualityScale,
+ bool ownContext) OVERRIDE;
+ virtual void drawPattern(GraphicsContext* destContext, const FloatRect& srcRect, const AffineTransform& patternTransform,
+ const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator op,
+ const FloatRect& destRect, bool ownContext) OVERRIDE;
+ virtual void clip(GraphicsContext* context, const FloatRect& floatRect) const OVERRIDE;
+ virtual void platformTransformColorSpace(const Vector<int>& lookUpTable) OVERRIDE;
+
+ // TextureMapperPlatformLayer:
+ virtual void paintToTextureMapper(TextureMapper*, const FloatRect&, const TransformationMatrix& modelViewMatrix = TransformationMatrix(), float opacity = 1.0) OVERRIDE;
+#if USE(GRAPHICS_SURFACE)
+ virtual IntSize platformLayerSize() const OVERRIDE;
+ virtual uint32_t copyToGraphicsSurface() OVERRIDE;
+ virtual GraphicsSurfaceToken graphicsSurfaceToken() const OVERRIDE;
+ RefPtr<GraphicsSurface> m_graphicsSurface;
+#endif
+private:
+ QFramebufferPaintDevice* m_paintDevice;
+ ImageBufferContext* m_context;
+};
+
+ImageBufferDataPrivateAccelerated::ImageBufferDataPrivateAccelerated(const IntSize& size, QOpenGLContext* sharedContext)
+{
+ m_context = new ImageBufferContext(sharedContext);
+ m_context->makeCurrentIfNeeded();
+
+ m_paintDevice = new QFramebufferPaintDevice(size);
+}
+
+ImageBufferDataPrivateAccelerated::~ImageBufferDataPrivateAccelerated()
+{
+ if (TextureMapperPlatformLayer::Client* client = TextureMapperPlatformLayer::client())
+ client->platformLayerWasDestroyed();
+ delete m_paintDevice;
+ delete m_context;
+}
+
+QImage ImageBufferDataPrivateAccelerated::toQImage() const
+{
+ invalidateState();
+ return m_paintDevice->toImage();
+}
+
+PassRefPtr<Image> ImageBufferDataPrivateAccelerated::image() const
+{
+ return copyImage();
+}
+
+PassRefPtr<Image> ImageBufferDataPrivateAccelerated::copyImage() const
+{
+ return StillImage::create(QPixmap::fromImage(toQImage()));
+}
+
+void ImageBufferDataPrivateAccelerated::invalidateState() const
+{
+ // This will flush pending QPainter operations and force ensureActiveTarget() to be called on the next paint.
+ QOpenGL2PaintEngineEx* acceleratedPaintEngine = static_cast<QOpenGL2PaintEngineEx*>(m_paintDevice->paintEngine());
+ acceleratedPaintEngine->invalidateState();
+}
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebCore/platform/graphics/qt/ImageBufferDataQt.h
^
|
@@ -23,27 +23,52 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#ifndef ImageBufferDataQt_h
+#define ImageBufferDataQt_h
+
#include "Image.h"
+#include <QImage>
+#include <QOpenGLContext>
#include <QPainter>
-#include <QPixmap>
+#include <QPaintDevice>
-#include <wtf/OwnPtr.h>
#include <wtf/RefPtr.h>
namespace WebCore {
class IntSize;
-class ImageBufferData {
+struct ImageBufferDataPrivate {
+ virtual ~ImageBufferDataPrivate() { }
+ virtual QPaintDevice* paintDevice() = 0;
+ virtual QImage toQImage() const = 0;
+ virtual PassRefPtr<Image> image() const = 0;
+ virtual PassRefPtr<Image> copyImage() const = 0;
+ virtual bool isAccelerated() const = 0;
+ virtual PlatformLayer* platformLayer() = 0;
+ virtual void draw(GraphicsContext* destContext, ColorSpace styleColorSpace, const FloatRect& destRect,
+ const FloatRect& srcRect, CompositeOperator op, BlendMode blendMode, bool useLowQualityScale,
+ bool ownContext) = 0;
+ virtual void drawPattern(GraphicsContext* destContext, const FloatRect& srcRect, const AffineTransform& patternTransform,
+ const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator op,
+ const FloatRect& destRect, bool ownContext) = 0;
+ virtual void clip(GraphicsContext* context, const FloatRect& floatRect) const = 0;
+ virtual void platformTransformColorSpace(const Vector<int>& lookUpTable) = 0;
+};
+
+class ImageBufferData
+{
public:
ImageBufferData(const IntSize&);
-
- QImage toQImage() const;
-
- QPixmap m_pixmap;
- OwnPtr<QPainter> m_painter;
- RefPtr<Image> m_image;
+ ImageBufferData(const IntSize&, QOpenGLContext*);
+ ~ImageBufferData();
+ QPainter* m_painter;
+ ImageBufferDataPrivate* m_impl;
+protected:
+ void initPainter();
};
} // namespace WebCore
+
+#endif
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebCore/platform/graphics/qt/ImageBufferQt.cpp
^
|
@@ -3,6 +3,7 @@
* Copyright (C) 2008 Holger Hans Peter Freyther
* Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
* Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved.
+ * Copyright (C) 2014 Digia Plc. and/or its subsidiary(-ies)
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -38,7 +39,6 @@
#include <wtf/text/WTFString.h>
#include <QBuffer>
-#include <QColor>
#include <QImage>
#include <QImageWriter>
#include <QPainter>
@@ -47,54 +47,19 @@
namespace WebCore {
-ImageBufferData::ImageBufferData(const IntSize& size)
- : m_pixmap(size)
+ImageBuffer::ImageBuffer(const IntSize& size, float /* resolutionScale */, ColorSpace, QOpenGLContext* compatibleContext, bool& success)
+ : m_data(size, compatibleContext)
+ , m_size(size)
+ , m_logicalSize(size)
{
- if (m_pixmap.isNull())
- return;
-
- m_pixmap.fill(QColor(Qt::transparent));
-
- QPainter* painter = new QPainter;
- m_painter = adoptPtr(painter);
-
- if (!painter->begin(&m_pixmap))
+ success = m_data.m_painter && m_data.m_painter->isActive();
+ if (!success)
return;
- // Since ImageBuffer is used mainly for Canvas, explicitly initialize
- // its painter's pen and brush with the corresponding canvas defaults
- // NOTE: keep in sync with CanvasRenderingContext2D::State
- QPen pen = painter->pen();
- pen.setColor(Qt::black);
- pen.setWidth(1);
- pen.setCapStyle(Qt::FlatCap);
- pen.setJoinStyle(Qt::SvgMiterJoin);
- pen.setMiterLimit(10);
- painter->setPen(pen);
- QBrush brush = painter->brush();
- brush.setColor(Qt::black);
- painter->setBrush(brush);
- painter->setCompositionMode(QPainter::CompositionMode_SourceOver);
-
- m_image = StillImage::createForRendering(&m_pixmap);
-}
-
-QImage ImageBufferData::toQImage() const
-{
- QPaintEngine* paintEngine = m_pixmap.paintEngine();
- if (!paintEngine || paintEngine->type() != QPaintEngine::Raster)
- return m_pixmap.toImage();
-
- // QRasterPixmapData::toImage() will deep-copy the backing QImage if there's an active QPainter on it.
- // For performance reasons, we don't want that here, so we temporarily redirect the paint engine.
- QPaintDevice* currentPaintDevice = paintEngine->paintDevice();
- paintEngine->setPaintDevice(0);
- QImage image = m_pixmap.toImage();
- paintEngine->setPaintDevice(currentPaintDevice);
- return image;
+ m_context = adoptPtr(new GraphicsContext(m_data.m_painter));
}
-ImageBuffer::ImageBuffer(const IntSize& size, float /* resolutionScale */, ColorSpace, RenderingMode, bool& success)
+ImageBuffer::ImageBuffer(const IntSize& size, float /* resolutionScale */, ColorSpace, RenderingMode /*renderingMode*/, bool& success)
: m_data(size)
, m_size(size)
, m_logicalSize(size)
@@ -103,13 +68,22 @@
if (!success)
return;
- m_context = adoptPtr(new GraphicsContext(m_data.m_painter.get()));
+ m_context = adoptPtr(new GraphicsContext(m_data.m_painter));
}
ImageBuffer::~ImageBuffer()
{
}
+PassOwnPtr<ImageBuffer> ImageBuffer::createCompatibleBuffer(const IntSize& size, float resolutionScale, ColorSpace colorSpace, QOpenGLContext* context)
+{
+ bool success = false;
+ OwnPtr<ImageBuffer> buf = adoptPtr(new ImageBuffer(size, resolutionScale, colorSpace, context, success));
+ if (!success)
+ return nullptr;
+ return buf.release();
+}
+
GraphicsContext* ImageBuffer::context() const
{
ASSERT(m_data.m_painter->isActive());
@@ -120,9 +94,9 @@
PassRefPtr<Image> ImageBuffer::copyImage(BackingStoreCopy copyBehavior, ScaleBehavior) const
{
if (copyBehavior == CopyBackingStore)
- return StillImage::create(m_data.m_pixmap);
+ return m_data.m_impl->copyImage();
- return StillImage::createForRendering(&m_data.m_pixmap);
+ return m_data.m_impl->image();
}
BackingStoreCopy ImageBuffer::fastCopyImageMode()
@@ -131,66 +105,25 @@
}
void ImageBuffer::draw(GraphicsContext* destContext, ColorSpace styleColorSpace, const FloatRect& destRect, const FloatRect& srcRect,
- CompositeOperator op, BlendMode blendMode, bool useLowQualityScale)
+ CompositeOperator op, BlendMode blendMode, bool useLowQualityScale)
{
- if (destContext == context()) {
- // We're drawing into our own buffer. In order for this to work, we need to copy the source buffer first.
- RefPtr<Image> copy = copyImage(CopyBackingStore);
- destContext->drawImage(copy.get(), ColorSpaceDeviceRGB, destRect, srcRect, op, blendMode, DoNotRespectImageOrientation, useLowQualityScale);
- } else
- destContext->drawImage(m_data.m_image.get(), styleColorSpace, destRect, srcRect, op, blendMode, DoNotRespectImageOrientation, useLowQualityScale);
+ m_data.m_impl->draw(destContext, styleColorSpace, destRect, srcRect, op, blendMode, useLowQualityScale, destContext == context());
}
void ImageBuffer::drawPattern(GraphicsContext* destContext, const FloatRect& srcRect, const AffineTransform& patternTransform,
const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator op, const FloatRect& destRect)
{
- if (destContext == context()) {
- // We're drawing into our own buffer. In order for this to work, we need to copy the source buffer first.
- RefPtr<Image> copy = copyImage(CopyBackingStore);
- copy->drawPattern(destContext, srcRect, patternTransform, phase, styleColorSpace, op, destRect);
- } else
- m_data.m_image->drawPattern(destContext, srcRect, patternTransform, phase, styleColorSpace, op, destRect);
+ m_data.m_impl->drawPattern(destContext, srcRect, patternTransform, phase, styleColorSpace, op, destRect, destContext == context());
}
void ImageBuffer::clip(GraphicsContext* context, const FloatRect& floatRect) const
{
- QPixmap* nativeImage = m_data.m_image->nativeImageForCurrentFrame();
- if (!nativeImage)
- return;
-
- IntRect rect = enclosingIntRect(floatRect);
- QPixmap alphaMask = *nativeImage;
-
- context->pushTransparencyLayerInternal(rect, 1.0, alphaMask);
+ m_data.m_impl->clip(context, floatRect);
}
void ImageBuffer::platformTransformColorSpace(const Vector<int>& lookUpTable)
{
- bool isPainting = m_data.m_painter->isActive();
- if (isPainting)
- m_data.m_painter->end();
-
- QImage image = m_data.toQImage().convertToFormat(QImage::Format_ARGB32);
- ASSERT(!image.isNull());
-
- uchar* bits = image.bits();
- const int bytesPerLine = image.bytesPerLine();
-
- for (int y = 0; y < m_size.height(); ++y) {
- quint32* scanLine = reinterpret_cast_ptr<quint32*>(bits + y * bytesPerLine);
- for (int x = 0; x < m_size.width(); ++x) {
- QRgb& pixel = scanLine[x];
- pixel = qRgba(lookUpTable[qRed(pixel)],
- lookUpTable[qGreen(pixel)],
- lookUpTable[qBlue(pixel)],
- qAlpha(pixel));
- }
- }
-
- m_data.m_pixmap = QPixmap::fromImage(image);
-
- if (isPainting)
- m_data.m_painter->begin(&m_data.m_pixmap);
+ m_data.m_impl->platformTransformColorSpace(lookUpTable);
}
template <Multiply multiplied>
@@ -207,10 +140,11 @@
if (rect.x() < 0 || rect.y() < 0 || rect.maxX() > size.width() || rect.maxY() > size.height())
image.fill(0);
- // Let drawPixmap deal with the conversion.
+ // Let drawImage deal with the conversion.
+ // FIXME: This is inefficient for accelerated ImageBuffers when only part of the imageData is read.
QPainter painter(&image);
painter.setCompositionMode(QPainter::CompositionMode_Source);
- painter.drawPixmap(QPoint(0,0), imageData.m_pixmap, rect);
+ painter.drawImage(QPoint(0,0), imageData.m_impl->toQImage(), rect);
painter.end();
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.cpp
^
|
@@ -114,6 +114,7 @@
, m_preload(MediaPlayer::Auto)
, m_bytesLoadedAtLastDidLoadingProgress(0)
, m_suppressNextPlaybackChanged(false)
+ , m_prerolling(false)
{
m_mediaPlayer->setVideoOutput(this);
@@ -245,9 +246,8 @@
// Setting a media source will start loading the media, but we need
// to pre-roll as well to get video size-hints and buffer-status
if (m_webCorePlayer->paused())
- m_mediaPlayer->pause();
- else
- m_mediaPlayer->play();
+ m_prerolling = true;
+ m_mediaPlayer->play();
}
void MediaPlayerPrivateQt::resumeLoad()
@@ -272,6 +272,7 @@
void MediaPlayerPrivateQt::play()
{
+ m_prerolling = false;
if (m_mediaPlayer->state() != QMediaPlayer::PlayingState)
m_mediaPlayer->play();
}
@@ -284,7 +285,7 @@
bool MediaPlayerPrivateQt::paused() const
{
- return (m_mediaPlayer->state() != QMediaPlayer::PlayingState);
+ return (m_prerolling || m_mediaPlayer->state() != QMediaPlayer::PlayingState);
}
void MediaPlayerPrivateQt::seek(float position)
@@ -411,8 +412,16 @@
{
}
-void MediaPlayerPrivateQt::mediaStatusChanged(QMediaPlayer::MediaStatus)
+void MediaPlayerPrivateQt::mediaStatusChanged(QMediaPlayer::MediaStatus status)
{
+ // Pre-roll done
+ if (m_prerolling && (status == QMediaPlayer::BufferingMedia || status == QMediaPlayer::BufferedMedia)) {
+ // Don't send PlaybackChanged notification for pre-roll.
+ m_suppressNextPlaybackChanged = true;
+ m_prerolling = false;
+ m_mediaPlayer->pause();
+ }
+
updateStates();
}
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.h
^
|
@@ -161,6 +161,7 @@
bool m_delayingLoad;
String m_mediaUrl;
bool m_suppressNextPlaybackChanged;
+ bool m_prerolling;
};
}
|
[-]
[+]
|
Added |
qtwebkit-5.4.1.tar.xz/Source/WebCore/platform/graphics/qt/QFramebufferPaintDevice.cpp
^
|
@@ -0,0 +1,69 @@
+/*
+ Copyright (C) 2014 Digia Plc. and/or its subsidiary(-ies)
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "config.h"
+#include "QFramebufferPaintDevice.h"
+#include <QOpenGLFunctions>
+
+QFramebufferPaintDevice::QFramebufferPaintDevice(const QSize& size,
+ QOpenGLFramebufferObject::Attachment attachment,
+ bool clearOnInit)
+ : QOpenGLPaintDevice(size)
+ , m_framebufferObject(size, attachment)
+{
+ m_surface = QOpenGLContext::currentContext()->surface();
+#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0)
+ setPaintFlipped(true);
+#endif
+ if (clearOnInit) {
+ m_framebufferObject.bind();
+
+ context()->functions()->glClearColor(0, 0, 0, 0);
+ context()->functions()->glClear(GL_COLOR_BUFFER_BIT);
+ }
+}
+
+void QFramebufferPaintDevice::ensureActiveTarget()
+{
+ if (QOpenGLContext::currentContext() != context())
+ context()->makeCurrent(m_surface);
+
+ m_framebufferObject.bind();
+}
+
+QImage QFramebufferPaintDevice::toImage() const
+{
+ QOpenGLContext* currentContext = QOpenGLContext::currentContext();
+ QSurface* currentSurface = currentContext ? currentContext->surface() : 0;
+
+ context()->makeCurrent(m_surface);
+
+#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0)
+ QImage image = m_framebufferObject.toImage(false);
+#else
+ QImage image = m_framebufferObject.toImage();
+#endif
+
+ if (currentContext)
+ currentContext->makeCurrent(currentSurface);
+ else
+ context()->doneCurrent();
+
+ return image;
+}
|
[-]
[+]
|
Added |
qtwebkit-5.4.1.tar.xz/Source/WebCore/platform/graphics/qt/QFramebufferPaintDevice.h
^
|
@@ -0,0 +1,56 @@
+/*
+ Copyright (C) 2014 Digia Plc. and/or its subsidiary(-ies)
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef QFramebufferPaintDevice_h
+#define QFramebufferPaintDevice_h
+
+#include <QImage>
+#include <QOpenGLPaintDevice>
+#include <QOpenGLFramebufferObject>
+#include <QSurface>
+
+class QFramebufferPaintDevice : public QOpenGLPaintDevice {
+public:
+ QFramebufferPaintDevice(const QSize& size,
+ QOpenGLFramebufferObject::Attachment attachment = QOpenGLFramebufferObject::CombinedDepthStencil,
+ bool clearOnInit = true);
+
+ // QOpenGLPaintDevice:
+ virtual void ensureActiveTarget() Q_DECL_OVERRIDE;
+
+ bool isValid() const { return m_framebufferObject.isValid(); }
+ GLuint handle() const { return m_framebufferObject.handle(); }
+ GLuint texture() const { return m_framebufferObject.texture(); }
+ QImage toImage() const;
+
+ bool bind() { return m_framebufferObject.bind(); }
+ bool release() { return m_framebufferObject.release(); }
+ QSize size() const { return m_framebufferObject.size(); }
+
+ QOpenGLFramebufferObject* framebufferObject() { return &m_framebufferObject; }
+ const QOpenGLFramebufferObject* framebufferObject() const { return &m_framebufferObject; }
+
+ static bool isSupported() { return QOpenGLFramebufferObject::hasOpenGLFramebufferObjects(); }
+
+private:
+ QOpenGLFramebufferObject m_framebufferObject;
+ QSurface* m_surface;
+};
+
+#endif
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebCore/platform/graphics/surfaces/glx/GLXConfigSelector.h
^
|
@@ -40,7 +40,7 @@
static_cast<int>(GLX_VISUAL_ID), 0,
GLX_DRAWABLE_TYPE, GLX_PIXMAP_BIT,
GLX_BIND_TO_TEXTURE_TARGETS_EXT, GLX_TEXTURE_2D_BIT_EXT,
- GLX_BIND_TO_TEXTURE_RGBA_EXT, TRUE,
+ GLX_BIND_TO_TEXTURE_RGBA_EXT, GL_TRUE,
0
};
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebCore/platform/graphics/surfaces/glx/GraphicsSurfaceGLX.cpp
^
|
@@ -31,6 +31,7 @@
#include <QGuiApplication>
#include <QOpenGLContext>
#include <qpa/qplatformnativeinterface.h>
+#include <GL/gl.h>
#include <GL/glext.h>
#include <GL/glx.h>
#else
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp
^
|
@@ -36,9 +36,7 @@
#include "TextureMapperPlatformLayer.h"
#include <wtf/CurrentTime.h>
#include <wtf/HashMap.h>
-#ifndef NDEBUG
#include <wtf/TemporaryChange.h>
-#endif
#include <wtf/text/CString.h>
namespace WebCore {
@@ -102,9 +100,7 @@
CoordinatedGraphicsLayer::CoordinatedGraphicsLayer(GraphicsLayerClient* client)
: GraphicsLayer(client)
-#ifndef NDEBUG
, m_isPurging(false)
-#endif
, m_shouldUpdateVisibleRect(true)
, m_shouldSyncLayerState(true)
, m_shouldSyncChildren(true)
@@ -996,6 +992,8 @@
{
ASSERT(m_coordinator);
ASSERT(m_coordinator->isFlushingLayerChanges() || m_isPurging);
+ if (m_isPurging)
+ return;
m_layerState.tilesToRemove.append(tileID);
}
@@ -1047,9 +1045,7 @@
void CoordinatedGraphicsLayer::purgeBackingStores()
{
-#ifndef NDEBUG
TemporaryChange<bool> updateModeProtector(m_isPurging, true);
-#endif
m_mainBackingStore.clear();
m_previousBackingStore.clear();
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h
^
|
@@ -218,9 +218,7 @@
FloatPoint m_adjustedPosition;
FloatPoint3D m_adjustedAnchorPoint;
-#ifndef NDEBUG
bool m_isPurging;
-#endif
bool m_shouldUpdateVisibleRect: 1;
bool m_shouldSyncLayerState: 1;
bool m_shouldSyncChildren: 1;
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.cpp
^
|
@@ -690,12 +690,14 @@
m_rootLayer.clear();
m_rootLayerID = InvalidCoordinatedLayerID;
- m_layers.clear();
- m_fixedLayers.clear();
m_textureMapper.clear();
m_backingStores.clear();
m_backingStoresWithPendingBuffers.clear();
+ LayerMap::iterator end = m_layers.end();
+ for (LayerMap::iterator it = m_layers.begin(); it != end; ++it)
+ it->value->setBackingStore(0);
+
setActive(false);
dispatchOnMainThread(bind(&CoordinatedGraphicsScene::purgeBackingStores, this));
}
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebCore/platform/network/MIMESniffing.cpp
^
|
@@ -331,6 +331,7 @@
return 0;
}
+#if !ASSERT_DISABLED
bool isTypeInList(const char* type, const MagicNumbers* types, size_t typesCount)
{
for (size_t i = 0; i < typesCount; ++i) {
@@ -339,6 +340,7 @@
}
return false;
}
+#endif
// http://tools.ietf.org/html/draft-abarth-mime-sniff-06#page-8
static const char* internalTextOrBinaryTypeSniffingProcedure(const char* data, size_t dataSize)
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebCore/platform/network/qt/QNetworkReplyHandler.cpp
^
|
@@ -453,7 +453,7 @@
m_method = QNetworkAccessManager::PostOperation;
else if (r.httpMethod() == "PUT")
m_method = QNetworkAccessManager::PutOperation;
- else if (r.httpMethod() == "DELETE")
+ else if (r.httpMethod() == "DELETE" && !r.httpBody()) // A delete with a body is a custom operation.
m_method = QNetworkAccessManager::DeleteOperation;
else
m_method = QNetworkAccessManager::CustomOperation;
@@ -687,9 +687,12 @@
// -1 means we do not provide any data about transfer size to inspector so it would use
// Content-Length headers or content size to show transfer size.
client->didReceiveData(m_resourceHandle, buffer, readSize, -1);
+ // Check if the request has been aborted or this reply-handler was otherwise released.
+ if (wasAborted() || !m_replyWrapper)
+ break;
}
delete[] buffer;
- if (bytesAvailable > 0)
+ if (bytesAvailable > 0 && m_replyWrapper)
m_queue.requeue(&QNetworkReplyHandler::forwardData);
}
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebCore/platform/qt/PlatformKeyboardEventQt.cpp
^
|
@@ -119,10 +119,8 @@
case Qt::Key_Return:
case Qt::Key_Enter:
return ASCIILiteral("Enter");
- // 'Find'
case Qt::Key_Help:
return ASCIILiteral("Help");
- // 'Info'
case Qt::Key_Menu:
case Qt::Key_MenuKB:
return ASCIILiteral("Menu");
@@ -136,7 +134,6 @@
return ASCIILiteral("Cancel");
case Qt::Key_Escape:
return ASCIILiteral("Esc");
- // 'Exit'
case Qt::Key_Zoom:
return ASCIILiteral("Zoom");
case Qt::Key_Comma:
@@ -213,7 +210,6 @@
return ASCIILiteral("Insert");
case Qt::Key_Paste:
return ASCIILiteral("Paste");
- // 'Undo'
case Qt::Key_Dead_Grave:
return ASCIILiteral("DeadGrave");
case Qt::Key_Dead_Acute:
@@ -312,7 +308,6 @@
return ASCIILiteral("MediaRewind");
case Qt::Key_Subtitle:
return ASCIILiteral("Subtitle");
-#if QT_VERSION >= QT_VERSION_CHECK(5, 2, 0)
case Qt::Key_Blue:
return ASCIILiteral("Blue");
case Qt::Key_ChannelDown:
@@ -325,6 +320,19 @@
return ASCIILiteral("Red");
case Qt::Key_Yellow:
return ASCIILiteral("Yellow");
+#if QT_VERSION >= QT_VERSION_CHECK(5,4,0)
+ case Qt::Key_Find:
+ return ASCIILiteral("Find");
+ case Qt::Key_Info:
+ return ASCIILiteral("Info");
+ case Qt::Key_Exit:
+ return ASCIILiteral("Exit");
+ case Qt::Key_Undo:
+ return ASCIILiteral("Undo");
+ case Qt::Key_Guide:
+ return ASCIILiteral("Guide");
+ case Qt::Key_Settings:
+ return ASCIILiteral("Settings");
#endif
// Keys we have returned U+charcode for in the past.
// FIXME: Change them to correct standard values if others do.
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebCore/platform/qt/QWebPageClient.h
^
|
@@ -34,14 +34,11 @@
#include <GraphicsLayer.h>
#endif
-#if USE(3D_GRAPHICS)
-#include <GraphicsContext3D.h>
-#endif
-
#include <QPalette>
#include <QRect>
QT_BEGIN_NAMESPACE
+class QOpenGLContext;
class QStyle;
class QWindow;
QT_END_NAMESPACE
@@ -62,6 +59,7 @@
virtual void setInputMethodEnabled(bool enable) = 0;
virtual bool inputMethodEnabled() const = 0;
virtual bool makeOpenGLContextCurrentIfAvailable() { return false; }
+ virtual QOpenGLContext* openGLContextIfAvailable() { return 0; }
virtual void setInputMethodHints(Qt::InputMethodHints hint) = 0;
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebCore/platform/qt/RenderThemeQt.cpp
^
|
@@ -813,17 +813,19 @@
paintMediaBackground(p->painter, r);
if (MediaPlayer* player = mediaElement->player()) {
+ float duration = player->duration();
+
// Get the buffered parts of the media
RefPtr<TimeRanges> buffered = player->buffered();
- if (buffered->length() > 0 && player->duration() < std::numeric_limits<float>::infinity()) {
+ if (buffered->length() > 0 && duration > 0.0f && duration < std::numeric_limits<float>::infinity()) {
// Set the transform and brush
WorldMatrixTransformer transformer(p->painter, o, r);
p->painter->setBrush(getMediaControlForegroundColor());
// Paint each buffered section
for (int i = 0; i < buffered->length(); i++) {
- float startX = (buffered->start(i, IGNORE_EXCEPTION) / player->duration()) * 100;
- float width = ((buffered->end(i, IGNORE_EXCEPTION) / player->duration()) * 100) - startX;
+ float startX = (buffered->start(i, IGNORE_EXCEPTION) / duration) * 100;
+ float width = ((buffered->end(i, IGNORE_EXCEPTION) / duration) * 100) - startX;
p->painter->drawRect(startX, 37, width, 26);
}
}
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebCore/platform/text/SegmentedString.cpp
^
|
@@ -181,7 +181,7 @@
for (; it != e; ++it)
append(*it);
}
- m_currentChar = m_currentString.m_length ? m_currentString.getCurrentChar() : 0;
+ m_currentChar = m_pushedChar1 ? m_pushedChar1 : (m_currentString.m_length ? m_currentString.getCurrentChar() : 0);
}
void SegmentedString::prepend(const SegmentedString& s)
@@ -195,7 +195,7 @@
prepend(*it);
}
prepend(s.m_currentString);
- m_currentChar = m_pushedChar1 ? m_pushedChar1 : (m_currentString.m_length ? m_currentString.getCurrentChar() : 0);
+ m_currentChar = m_currentString.m_length ? m_currentString.getCurrentChar() : 0;
}
void SegmentedString::advanceSubstring()
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebCore/platform/text/TextBreakIteratorICU.cpp
^
|
@@ -20,6 +20,7 @@
*/
#include "config.h"
+#if USE(ICU_UNICODE)
#include "TextBreakIterator.h"
#include "LineBreakIteratorPoolICU.h"
@@ -687,3 +688,4 @@
}
}
+#endif // #if USE(ICU_UNICODE)
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebCore/platform/text/TextEncodingDetectorICU.cpp
^
|
@@ -29,6 +29,7 @@
*/
#include "config.h"
+#if USE(ICU_UNICODE)
#include "TextEncodingDetector.h"
#include "TextEncoding.h"
@@ -115,3 +116,4 @@
}
}
+#endif // #if USE(ICU_UNICODE)
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebCore/plugins/PluginQuirkSet.h
^
|
@@ -49,7 +49,8 @@
PluginQuirkRequiresDefaultScreenDepth = 1 << 13,
PluginQuirkDontCallSetWindowMoreThanOnce = 1 << 14,
PluginQuirkIgnoreRightClickInWindowlessMode = 1 << 15,
- PluginQuirkWantsChromeUserAgent = 1 << 16
+ PluginQuirkWantsChromeUserAgent = 1 << 16,
+ PluginQuirkNeedsSetWindowTwice = 1 << 17
};
class PluginQuirkSet {
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebCore/plugins/PluginStream.cpp
^
|
@@ -307,8 +307,12 @@
if (!m_loadManually && m_client)
m_client->streamDidFinishLoading(this);
- if (!m_path.isNull())
- deleteFile(m_path);
+ if (!m_path.isNull()) {
+ if (m_client)
+ m_client->streamDidSaveTempFile(m_path);
+ else
+ deleteFile(m_path);
+ }
}
void PluginStream::delayDeliveryTimerFired(Timer<PluginStream>* timer)
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebCore/plugins/PluginStream.h
^
|
@@ -52,6 +52,7 @@
class PluginStreamClient {
public:
virtual ~PluginStreamClient() {}
+ virtual void streamDidSaveTempFile(const String &) {}
virtual void streamDidFinishLoading(PluginStream*) {}
};
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebCore/plugins/PluginView.cpp
^
|
@@ -383,6 +383,11 @@
LOG_NPERROR(npErr);
PluginView::setCurrentPluginView(0);
+ Vector<String>::iterator e = m_streamTempFilePaths.end();
+ for (Vector<String>::iterator it = m_streamTempFilePaths.begin(); it != e; ++it)
+ deleteFile(*it);
+ m_streamTempFilePaths.clear();
+
#if ENABLE(NETSCAPE_PLUGIN_API)
if (savedData) {
// TODO: Actually save this data instead of just discarding it
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebCore/plugins/PluginView.h
^
|
@@ -194,6 +194,7 @@
void privateBrowsingStateChanged(bool);
void disconnectStream(PluginStream*);
+ void streamDidSaveTempFile(const String &path) { m_streamTempFilePaths.append(path); }
void streamDidFinishLoading(PluginStream* stream) { disconnectStream(stream); }
// Widget functions
@@ -364,6 +365,7 @@
HashSet<RefPtr<PluginStream> > m_streams;
Vector<OwnPtr<PluginRequest> > m_requests;
+ Vector<String> m_streamTempFilePaths;
bool m_isWindowed;
bool m_isTransparent;
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebCore/plugins/mac/PluginViewMac.mm
^
|
@@ -248,6 +248,9 @@
Widget::setFocus(focused);
+ if (!m_plugin || !m_isStarted || m_status != PluginStatusLoadedSuccessfully)
+ return;
+
NPCocoaEvent cocoaEvent;
initializeNPCocoaEvent(&cocoaEvent);
cocoaEvent.type = NPCocoaEventFocusChanged;
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebCore/plugins/qt/PluginPackageQt.cpp
^
|
@@ -146,7 +146,8 @@
{
// TODO: enumerate all plugins that are incompatible with Qt5.
const QLatin1String pluginBlacklist[] = {
- QLatin1String("skypebuttons")
+ QLatin1String("skypebuttons"),
+ QLatin1String("libkpartsplugin")
};
QString baseName = QFileInfo(static_cast<QString>(m_path)).baseName();
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebCore/plugins/win/PluginPackageWin.cpp
^
|
@@ -162,6 +162,12 @@
if (compareFileVersion(lastKnownUnloadableRealPlayerVersion) > 0)
m_quirks.add(PluginQuirkDontUnloadPlugin);
}
+
+ // The Adobe Acrobat plugin only displays the pdf correctly on the first load if set window is
+ // called on it twice in a row.
+ if (name() == "Adobe Acrobat")
+ m_quirks.add(PluginQuirkNeedsSetWindowTwice);
+
}
bool PluginPackage::fetchInfo()
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebCore/plugins/win/PluginViewWin.cpp
^
|
@@ -865,6 +865,8 @@
JSC::JSLock::DropAllLocks dropAllLocks(JSDOMWindowBase::commonVM());
setCallingPlugin(true);
m_plugin->pluginFuncs()->setwindow(m_instance, &m_npWindow);
+ if (m_plugin->quirks().contains(PluginQuirkNeedsSetWindowTwice))
+ m_plugin->pluginFuncs()->setwindow(m_instance, &m_npWindow);
setCallingPlugin(false);
m_haveCalledSetWindow = true;
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebCore/rendering/RenderBlockLineLayout.cpp
^
|
@@ -423,7 +423,7 @@
if (currpoint == lBreak) {
// We hit the line break before the start point. Shave off the start point.
lineMidpointState.numMidpoints--;
- if (endpoint.m_obj->style()->collapseWhiteSpace())
+ if (endpoint.m_obj->style()->collapseWhiteSpace() && endpoint.m_obj->isText())
endpoint.m_pos--;
}
}
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebCore/rendering/RenderLayerBacking.cpp
^
|
@@ -315,7 +315,8 @@
m_childContainmentLayer = createGraphicsLayer("TiledBacking Flattening Layer");
if (m_isMainFrameRenderViewLayer) {
- m_graphicsLayer->setContentsOpaque(true);
+ bool viewIsTransparent = compositor()->viewHasTransparentBackground(0);
+ m_graphicsLayer->setContentsOpaque(!viewIsTransparent);
m_graphicsLayer->setAppliesPageScale();
}
@@ -1925,35 +1926,32 @@
{
ASSERT(!paintsIntoCompositedAncestor());
+ LayoutRect layerDirtyRect(r);
+ layerDirtyRect.move(m_subpixelAccumulation);
if (m_graphicsLayer && m_graphicsLayer->drawsContent()) {
- IntRect layerDirtyRect = r;
layerDirtyRect.move(-m_graphicsLayer->offsetFromRenderer());
- m_graphicsLayer->setNeedsDisplayInRect(layerDirtyRect);
+ m_graphicsLayer->setNeedsDisplayInRect(enclosingIntRect(layerDirtyRect));
}
if (m_foregroundLayer && m_foregroundLayer->drawsContent()) {
- IntRect layerDirtyRect = r;
layerDirtyRect.move(-m_foregroundLayer->offsetFromRenderer());
- m_foregroundLayer->setNeedsDisplayInRect(layerDirtyRect);
+ m_foregroundLayer->setNeedsDisplayInRect(enclosingIntRect(layerDirtyRect));
}
// FIXME: need to split out repaints for the background.
if (m_backgroundLayer && m_backgroundLayer->drawsContent()) {
- IntRect layerDirtyRect = r;
layerDirtyRect.move(-m_backgroundLayer->offsetFromRenderer());
- m_backgroundLayer->setNeedsDisplayInRect(layerDirtyRect);
+ m_backgroundLayer->setNeedsDisplayInRect(enclosingIntRect(layerDirtyRect));
}
if (m_maskLayer && m_maskLayer->drawsContent()) {
- IntRect layerDirtyRect = r;
layerDirtyRect.move(-m_maskLayer->offsetFromRenderer());
- m_maskLayer->setNeedsDisplayInRect(layerDirtyRect);
+ m_maskLayer->setNeedsDisplayInRect(enclosingIntRect(layerDirtyRect));
}
if (m_scrollingContentsLayer && m_scrollingContentsLayer->drawsContent()) {
- IntRect layerDirtyRect = r;
layerDirtyRect.move(-m_scrollingContentsLayer->offsetFromRenderer());
- m_scrollingContentsLayer->setNeedsDisplayInRect(layerDirtyRect);
+ m_scrollingContentsLayer->setNeedsDisplayInRect(enclosingIntRect(layerDirtyRect));
}
}
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebCore/rendering/RenderLayerCompositor.cpp
^
|
@@ -85,6 +85,7 @@
namespace WebCore {
static const int canvasAreaThresholdRequiringCompositing = 50 * 100;
+static const int largeAreaThresholdForCompositing = 8192 * 8192;
// During page loading delay layer flushes up to this many seconds to allow them coalesce, reducing workload.
static const double throttledLayerFlushDelay = .5;
@@ -1804,6 +1805,9 @@
bool RenderLayerCompositor::canBeComposited(const RenderLayer* layer) const
{
+ if (!(m_compositingTriggers & ChromeClient::LargeAreaTrigger) && layer->size().area() > largeAreaThresholdForCompositing)
+ return false;
+
// FIXME: We disable accelerated compositing for elements in a RenderFlowThread as it doesn't work properly.
// See http://webkit.org/b/84900 to re-enable it.
return m_hasAcceleratedCompositing && layer->isSelfPaintingLayer() && layer->renderer()->flowThreadState() == RenderObject::NotInsideFlowThread;
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebCore/rendering/RenderTable.cpp
^
|
@@ -805,6 +805,7 @@
}
m_columnPos.grow(numEffCols() + 1);
+ m_columnPos[numEffCols()] = m_columnPos[numEffCols() - 1];
}
void RenderTable::appendColumn(unsigned span)
@@ -826,6 +827,7 @@
}
m_columnPos.grow(numEffCols() + 1);
+ m_columnPos[numEffCols()] = m_columnPos[numEffCols() - 1];
}
RenderTableCol* RenderTable::firstColumn() const
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebCore/rendering/style/RenderStyle.cpp
^
|
@@ -1328,8 +1328,8 @@
float RenderStyle::computedFontSize() const { return fontDescription().computedSize(); }
int RenderStyle::fontSize() const { return inherited->font.pixelSize(); }
-int RenderStyle::wordSpacing() const { return inherited->font.wordSpacing(); }
-int RenderStyle::letterSpacing() const { return inherited->font.letterSpacing(); }
+float RenderStyle::wordSpacing() const { return inherited->font.wordSpacing(); }
+float RenderStyle::letterSpacing() const { return inherited->font.letterSpacing(); }
bool RenderStyle::setFontDescription(const FontDescription& v)
{
@@ -1374,8 +1374,8 @@
return lh.value();
}
-void RenderStyle::setWordSpacing(int v) { inherited.access()->font.setWordSpacing(v); }
-void RenderStyle::setLetterSpacing(int v) { inherited.access()->font.setLetterSpacing(v); }
+void RenderStyle::setWordSpacing(float v) { inherited.access()->font.setWordSpacing(v); }
+void RenderStyle::setLetterSpacing(float v) { inherited.access()->font.setLetterSpacing(v); }
void RenderStyle::setFontSize(float size)
{
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebCore/rendering/style/RenderStyle.h
^
|
@@ -579,8 +579,8 @@
#else
TextDecorationStyle textDecorationStyle() const { return TextDecorationStyleSolid; }
#endif // CSS3_TEXT
- int wordSpacing() const;
- int letterSpacing() const;
+ float wordSpacing() const;
+ float letterSpacing() const;
float zoom() const { return visual->m_zoom; }
float effectiveZoom() const { return rareInheritedData->m_effectiveZoom; }
@@ -1167,8 +1167,8 @@
void setWhiteSpace(EWhiteSpace v) { inherited_flags._white_space = v; }
- void setWordSpacing(int);
- void setLetterSpacing(int);
+ void setWordSpacing(float);
+ void setLetterSpacing(float);
void clearBackgroundLayers() { m_background.access()->m_background = FillLayer(BackgroundFillLayer); }
void inheritBackgroundLayers(const FillLayer& parent) { m_background.access()->m_background = parent; }
@@ -1607,7 +1607,8 @@
static unsigned initialBorderWidth() { return 3; }
static unsigned short initialColumnRuleWidth() { return 3; }
static unsigned short initialOutlineWidth() { return 3; }
- static int initialLetterWordSpacing() { return 0; }
+ static float initialLetterSpacing() { return 0; }
+ static float initialWordSpacing() { return 0; }
static Length initialSize() { return Length(); }
static Length initialMinSize() { return Length(Fixed); }
static Length initialMaxSize() { return Length(Undefined); }
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebCore/rendering/style/StylePendingImage.h
^
|
@@ -28,6 +28,9 @@
#include "CSSCursorImageValue.h"
#include "CSSImageGeneratorValue.h"
+#include "CSSImageValue.h"
+#include "StyleImage.h"
+
#if ENABLE(CSS_IMAGE_SET)
#include "CSSImageSetValue.h"
#endif
@@ -48,13 +51,15 @@
virtual WrappedImagePtr data() const { return static_cast<CSSImageValue*>(m_value); }
virtual PassRefPtr<CSSValue> cssValue() const { return m_value; }
- CSSImageValue* cssImageValue() const { return m_value->isImageValue() ? static_cast<CSSImageValue*>(m_value) : 0; }
- CSSImageGeneratorValue* cssImageGeneratorValue() const { return m_value->isImageGeneratorValue() ? static_cast<CSSImageGeneratorValue*>(m_value) : 0; }
- CSSCursorImageValue* cssCursorImageValue() const { return m_value->isCursorImageValue() ? static_cast<CSSCursorImageValue*>(m_value) : 0; }
+ CSSImageValue* cssImageValue() const { return m_value && m_value->isImageValue() ? static_cast<CSSImageValue*>(m_value) : 0; }
+ CSSImageGeneratorValue* cssImageGeneratorValue() const { return m_value && m_value->isImageGeneratorValue() ? static_cast<CSSImageGeneratorValue*>(m_value) : 0; }
+ CSSCursorImageValue* cssCursorImageValue() const { return m_value && m_value->isCursorImageValue() ? static_cast<CSSCursorImageValue*>(m_value) : 0; }
#if ENABLE(CSS_IMAGE_SET)
- CSSImageSetValue* cssImageSetValue() const { return m_value->isImageSetValue() ? static_cast<CSSImageSetValue*>(m_value) : 0; }
+ CSSImageSetValue* cssImageSetValue() const { return m_value && m_value->isImageSetValue() ? static_cast<CSSImageSetValue*>(m_value) : 0; }
#endif
-
+
+ void detachFromCSSValue() { m_value = 0; }
+
virtual LayoutSize imageSize(const RenderObject*, float /*multiplier*/) const OVERRIDE { return LayoutSize(); }
virtual bool imageHasRelativeWidth() const { return false; }
virtual bool imageHasRelativeHeight() const { return false; }
@@ -81,4 +86,5 @@
};
}
+
#endif
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebKit/qt/Api/qwebsettings.cpp
^
|
@@ -149,14 +149,19 @@
settings->setDNSPrefetchingEnabled(value);
value = attributes.value(QWebSettings::JavascriptEnabled,
- global->attributes.value(QWebSettings::JavascriptEnabled));
+ global->attributes.value(QWebSettings::JavascriptEnabled));
settings->setScriptEnabled(value);
#if USE(ACCELERATED_COMPOSITING)
value = attributes.value(QWebSettings::AcceleratedCompositingEnabled,
- global->attributes.value(QWebSettings::AcceleratedCompositingEnabled));
-
+ global->attributes.value(QWebSettings::AcceleratedCompositingEnabled));
settings->setAcceleratedCompositingEnabled(value);
+#if ENABLE(ACCELERATED_2D_CANVAS)
+ value = value && attributes.value(QWebSettings::Accelerated2dCanvasEnabled,
+ global->attributes.value(QWebSettings::Accelerated2dCanvasEnabled));
+ settings->setAccelerated2dCanvasEnabled(value);
+#endif
+
bool showDebugVisuals = qgetenv("WEBKIT_SHOW_COMPOSITING_DEBUG_VISUALS") == "1";
settings->setShowDebugBorders(showDebugVisuals);
settings->setShowRepaintCounter(showDebugVisuals);
@@ -517,6 +522,8 @@
\value CaretBrowsingEnabled This setting enables caret browsing. It is disabled by default.
\value NotificationsEnabled Specifies whether support for the HTML 5 web notifications is enabled
or not. This is enabled by default.
+ \value Accelerated2dCanvasEnabled Specifies whether the HTML5 2D canvas should be a OpenGL framebuffer.
+ This makes many painting operations faster, but slows down pixel access. This is disabled by default.
*/
/*!
@@ -572,6 +579,7 @@
d->attributes.insert(QWebSettings::ScrollAnimatorEnabled, false);
d->attributes.insert(QWebSettings::CaretBrowsingEnabled, false);
d->attributes.insert(QWebSettings::NotificationsEnabled, true);
+ d->attributes.insert(QWebSettings::Accelerated2dCanvasEnabled, false);
d->offlineStorageDefaultQuota = 5 * 1024 * 1024;
d->defaultTextEncoding = QLatin1String("iso-8859-1");
d->thirdPartyCookiePolicy = AlwaysAllowThirdPartyCookies;
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebKit/qt/Api/qwebsettings.h
^
|
@@ -86,7 +86,8 @@
ScrollAnimatorEnabled,
CaretBrowsingEnabled,
NotificationsEnabled,
- WebAudioEnabled
+ WebAudioEnabled,
+ Accelerated2dCanvasEnabled
};
enum WebGraphic {
MissingImageGraphic,
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebKit/qt/WebCoreSupport/InitWebCoreQt.cpp
^
|
@@ -72,11 +72,7 @@
if (initCallback) {
WebCore::RenderThemeQStyle::setStyleFactoryFunction(createStyleForPage);
WebCore::RenderThemeQt::setCustomTheme(WebCore::RenderThemeQStyle::create, new WebCore::ScrollbarThemeQStyle);
-#if QT_VERSION >= QT_VERSION_CHECK(5, 1, 0)
- // Only enable kerning by default in Qt 5.1 where it can use the fast font path.
- // In Qt 5.0 this would have forced the complex font path.
WebCore::Font::setDefaultTypesettingFeatures(WebCore::Kerning);
-#endif
}
}
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp
^
|
@@ -211,6 +211,7 @@
, forwardUnsupportedContent(false)
, insideOpenCall(false)
, clickCausedFocus(false)
+ , mousePressed(false)
, m_useNativeVirtualKeyAsDOMKey(false)
, m_totalBytes(0)
, m_bytesReceived()
@@ -475,9 +476,7 @@
if (!foundClickableNode)
return;
- QMouseEvent* ret = new QMouseEvent(ev->type(), QPoint(adjustedPoint), ev->globalPos(), ev->button(), ev->buttons(), ev->modifiers());
- delete ev;
- ev = ret;
+ *ev = QMouseEvent(ev->type(), QPoint(adjustedPoint), ev->globalPos(), ev->button(), ev->buttons(), ev->modifiers());
#else
Q_UNUSED(ev);
#endif
@@ -488,6 +487,8 @@
WebCore::Frame* frame = mainFrameAdapter()->frame;
if (!frame->view())
return;
+ if (ev->buttons() == Qt::NoButton)
+ mousePressed = false;
bool accepted = frame->eventHandler()->mouseMoved(convertMouseEvent(ev, 0));
ev->setAccepted(accepted);
@@ -514,7 +515,7 @@
PlatformMouseEvent mev = convertMouseEvent(ev, 1);
// ignore the event if we can't map Qt's mouse buttons to WebCore::MouseButton
if (mev.button() != NoButton)
- accepted = frame->eventHandler()->handleMousePressEvent(mev);
+ mousePressed = accepted = frame->eventHandler()->handleMousePressEvent(mev);
ev->setAccepted(accepted);
RefPtr<WebCore::Node> newNode;
@@ -570,6 +571,9 @@
accepted = frame->eventHandler()->handleMouseReleaseEvent(mev);
ev->setAccepted(accepted);
+ if (ev->buttons() == Qt::NoButton)
+ mousePressed = false;
+
handleSoftwareInputPanel(ev->button(), QPointF(ev->pos()).toPoint());
}
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.h
^
|
@@ -369,6 +369,7 @@
QBasicTimer tripleClickTimer;
bool clickCausedFocus;
+ bool mousePressed;
bool m_useNativeVirtualKeyAsDOMKey;
quint64 m_totalBytes;
quint64 m_bytesReceived;
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebKit/qt/WidgetApi/qwebpage.cpp
^
|
@@ -912,6 +912,10 @@
void QWebPagePrivate::leaveEvent(QEvent*)
{
+ // If a mouse button is pressed we will continue to receive mouse events after leaving the window.
+ if (mousePressed)
+ return;
+
// Fake a mouse move event just outside of the widget, since all
// the interesting mouse-out behavior like invalidating scrollbars
// is handled by the WebKit event handler's mouseMoved function.
@@ -2150,6 +2154,9 @@
return true;
case DelegateExternalLinks:
+ if (request.url().scheme().isEmpty() &&
+ QWebPageAdapter::treatSchemeAsLocal(frame->baseUrl().scheme()))
+ return true;
if (QWebPageAdapter::treatSchemeAsLocal(request.url().scheme()))
return true;
emit linkClicked(request.url());
@@ -3341,9 +3348,7 @@
\fn void QWebPage::scrollRequested(int dx, int dy, const QRect& rectToScroll)
This signal is emitted whenever the content given by \a rectToScroll needs
- to be scrolled \a dx and \a dy downwards and no view was set.
-
- \sa view()
+ to be scrolled \a dx and \a dy downwards.
*/
/*!
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebKit/qt/WidgetApi/qwebviewaccessible_p.h
^
|
@@ -22,11 +22,7 @@
#include <qaccessible.h>
#include <qaccessibleobject.h>
-#if QT_VERSION >= QT_VERSION_CHECK(5, 1, 0) && QT_VERSION < QT_VERSION_CHECK(5, 2, 0)
-#include <private/qaccessiblewidget_p.h>
-#else
#include <qaccessiblewidget.h>
-#endif
class QWebFrame;
class QWebPage;
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebKit/qt/WidgetSupport/PageClientQt.cpp
^
|
@@ -31,6 +31,9 @@
#ifdef QT_OPENGL_LIB
#include <QGLWidget>
#endif
+#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0)
+#include <QOpenGLWidget>
+#endif
#if USE(ACCELERATED_COMPOSITING)
#include "TextureMapper.h"
@@ -181,20 +184,54 @@
bool PageClientQGraphicsWidget::makeOpenGLContextCurrentIfAvailable()
{
-#if USE(ACCELERATED_COMPOSITING) && USE(TEXTURE_MAPPER_GL) && defined(QT_OPENGL_LIB)
+#if USE(ACCELERATED_COMPOSITING) && USE(TEXTURE_MAPPER_GL)
QGraphicsView* graphicsView = firstGraphicsView();
if (graphicsView && graphicsView->viewport()) {
- QGLWidget* glWidget = qobject_cast<QGLWidget*>(graphicsView->viewport());
- if (glWidget) {
+ QWidget *widget = graphicsView->viewport();
+#if defined(QT_OPENGL_LIB)
+ if (widget->inherits("QGLWidget")) {
+
+ QGLWidget* glWidget = static_cast<QGLWidget*>(widget);
// The GL context belonging to the QGLWidget viewport must be current when TextureMapper is being created.
glWidget->makeCurrent();
return true;
}
+#endif
+#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0)
+ if (widget->inherits("QOpenGLWidget")) {
+ QOpenGLWidget *qoglWidget = static_cast<QOpenGLWidget*>(widget);
+ qoglWidget->makeCurrent();
+ return true;
+ }
+#endif
}
#endif
return false;
}
+QOpenGLContext* PageClientQGraphicsWidget::openGLContextIfAvailable()
+{
+#if USE(ACCELERATED_COMPOSITING) && USE(TEXTURE_MAPPER_GL)
+ QGraphicsView* graphicsView = firstGraphicsView();
+ if (graphicsView && graphicsView->viewport()) {
+ QWidget *widget = graphicsView->viewport();
+#if defined(QT_OPENGL_LIB)
+ if (widget->inherits("QGLWidget")) {
+ QGLWidget* glWidget = static_cast<QGLWidget*>(widget);
+ return glWidget->context()->contextHandle();
+ }
+#endif
+#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0)
+ if (widget->inherits("QOpenGLWidget")) {
+ QOpenGLWidget *qoglWidget = static_cast<QOpenGLWidget*>(widget);
+ return qoglWidget->context();
+ }
+#endif
+ }
+#endif
+ return 0;
+}
+
void PageClientQGraphicsWidget::setInputMethodEnabled(bool enable)
{
view->setFlag(QGraphicsItem::ItemAcceptsInputMethod, enable);
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebKit/qt/WidgetSupport/PageClientQt.h
^
|
@@ -174,6 +174,7 @@
#endif
virtual bool makeOpenGLContextCurrentIfAvailable();
+ virtual QOpenGLContext* openGLContextIfAvailable();
virtual QRectF windowRect() const;
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebKit/qt/WidgetSupport/QStyleFacadeImp.cpp
^
|
@@ -248,8 +248,8 @@
QWidget* widget = qobject_cast<QWidget*>(widgetForPainter(painter));
MappedStyleOption<QStyleOptionButton> option(widget, proxyOption);
- if (m_style->inherits("QWindowsVistaStyle"))
- option.styleObject = 0;
+ if (option.styleObject)
+ option.styleObject->setProperty("_q_no_animation", true);
if (type == PushButton)
style()->drawControl(QStyle::CE_PushButton, &option, painter, widget);
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebKit/qt/WidgetSupport/QWidgetPluginImpl.cpp
^
|
@@ -54,7 +54,9 @@
void QWidgetPluginImpl::setStyleSheet(const QString &stylesheet)
{
+#ifndef QT_NO_STYLE_STYLESHEET
m_widget->setStyleSheet(stylesheet);
+#endif
}
void QWidgetPluginImpl::setWidgetParent(QObject *parent)
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebKit/qt/declarative/public.pri
^
|
@@ -40,15 +40,16 @@
QT += network
}
-# The fallback to QT_INSTALL_IMPORTS can be removed once we
-# depend on Qt 5 RC1.
-importPath = $$[QT_INSTALL_QML]
-isEmpty(importPath): importPath = $$[QT_INSTALL_IMPORTS]
-
-target.path = $${importPath}/$${TARGET.module_name}
+importPath = $$[QT_INSTALL_QML]
+isEmpty(importPath){
+ importPath = $$[QT_INSTALL_IMPORTS]
+} else {
+ target.path = $${importPath}/$${TARGET.module_name}
+ INSTALLS += target
+}
qmldir.files += $$PWD/qmldir $$PWD/plugins.qmltypes
qmldir.path += $${importPath}/$${TARGET.module_name}
-INSTALLS += target qmldir
+INSTALLS += qmldir
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebKit2/Target.pri
^
|
@@ -860,6 +860,13 @@
SOURCES += \
UIProcess/qt/WebColorPickerQt.cpp
}
+
+ qtHaveModule(webchannel) {
+ SOURCES += \
+ UIProcess/API/qt/qwebchannelwebkittransport.cpp
+ HEADERS += \
+ UIProcess/API/qt/qwebchannelwebkittransport_p.h
+ }
}
mac: {
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp
^
|
@@ -84,6 +84,11 @@
#include <wtf/Vector.h>
#include <wtf/text/WTFString.h>
+#ifdef HAVE_WEBCHANNEL
+#include <QtWebChannel/QQmlWebChannel>
+#include "qwebchannelwebkittransport_p.h"
+#endif
+
using namespace WebCore;
using namespace WebKit;
@@ -960,6 +965,14 @@
emit q_ptr->experimental()->messageReceived(variantMap);
}
+#ifdef HAVE_WEBCHANNEL
+void QQuickWebViewPrivate::didReceiveMessageFromNavigatorQtWebChannelTransportObject(WKStringRef message)
+{
+ // TODO: can I convert a WKStringRef to a UTF8 QByteArray directly?
+ q_ptr->experimental()->m_webChannelTransport->receiveMessage(WKStringCopyQString(message).toUtf8());
+}
+#endif
+
CoordinatedGraphicsScene* QQuickWebViewPrivate::coordinatedGraphicsScene()
{
if (webPageProxy && webPageProxy->drawingArea() && webPageProxy->drawingArea()->coordinatedLayerTreeHostProxy())
@@ -1075,7 +1088,14 @@
, d_ptr(webViewPrivate)
, schemeParent(new QObject(this))
, m_test(new QWebKitTest(webViewPrivate, this))
+#ifdef HAVE_WEBCHANNEL
+ , m_webChannel(new QQmlWebChannel(this))
+ , m_webChannelTransport(new QWebChannelWebKitTransport(this))
+#endif
{
+#ifdef HAVE_WEBCHANNEL
+ m_webChannel->connectTo(m_webChannelTransport);
+#endif
}
QQuickWebViewExperimental::~QQuickWebViewExperimental()
@@ -1164,6 +1184,29 @@
return s_flickableViewportEnabled;
}
+#ifdef HAVE_WEBCHANNEL
+QQmlWebChannel* QQuickWebViewExperimental::webChannel() const
+{
+ return m_webChannel;
+}
+
+void QQuickWebViewExperimental::setWebChannel(QQmlWebChannel* channel)
+{
+ if (channel == m_webChannel)
+ return;
+
+ if (m_webChannel)
+ m_webChannel->disconnectFrom(m_webChannelTransport);
+
+ m_webChannel = channel;
+
+ if (m_webChannel)
+ m_webChannel->connectTo(m_webChannelTransport);
+
+ emit webChannelChanged(channel);
+}
+#endif
+
/*!
\internal
@@ -1183,6 +1226,16 @@
WKPagePostMessageToInjectedBundle(d->webPage.get(), messageName, contents.get());
}
+#ifdef HAVE_WEBCHANNEL
+void QQuickWebViewExperimental::postQtWebChannelTransportMessage(const QByteArray& message)
+{
+ Q_D(QQuickWebView);
+ static WKStringRef messageName = WKStringCreateWithUTF8CString("MessageToNavigatorQtWebChannelTransportObject");
+ WKRetainPtr<WKStringRef> contents = adoptWK(WKStringCreateWithUTF8CString(message.constData()));
+ WKPagePostMessageToInjectedBundle(d->webPage.get(), messageName, contents.get());
+}
+#endif
+
QQmlComponent* QQuickWebViewExperimental::alertDialog() const
{
Q_D(const QQuickWebView);
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebKit2/UIProcess/API/qt/qquickwebview_p.h
^
|
@@ -30,6 +30,7 @@
QT_BEGIN_NAMESPACE
class QQmlComponent;
+class QQmlWebChannel;
QT_END_NAMESPACE
class QWebNavigationRequest;
class QQuickWebPage;
@@ -43,6 +44,7 @@
class QWebPermissionRequest;
class QWebKitTest;
class QQuickNetworkReply;
+class QWebChannelWebKitTransport;
namespace WTR {
class PlatformWebView;
@@ -280,6 +282,9 @@
Q_PROPERTY(QString userAgent READ userAgent WRITE setUserAgent NOTIFY userAgentChanged)
Q_PROPERTY(QList<QUrl> userScripts READ userScripts WRITE setUserScripts NOTIFY userScriptsChanged)
Q_PROPERTY(QUrl remoteInspectorUrl READ remoteInspectorUrl NOTIFY remoteInspectorUrlChanged FINAL)
+#ifdef HAVE_WEBCHANNEL
+ Q_PROPERTY(QQmlWebChannel* webChannel READ webChannel WRITE setWebChannel NOTIFY webChannelChanged)
+#endif
Q_ENUMS(NavigationRequestActionExperimental)
Q_FLAGS(FindFlags)
@@ -357,6 +362,12 @@
static void setFlickableViewportEnabled(bool enable);
static bool flickableViewportEnabled();
+#ifdef HAVE_WEBCHANNEL
+ QQmlWebChannel* webChannel() const;
+ void setWebChannel(QQmlWebChannel* channel);
+ void postQtWebChannelTransportMessage(const QByteArray& message);
+#endif
+
public Q_SLOTS:
void goBackTo(int index);
void goForwardTo(int index);
@@ -394,6 +405,10 @@
void processDidBecomeUnresponsive();
void processDidBecomeResponsive();
+#ifdef HAVE_WEBCHANNEL
+ void webChannelChanged(QQmlWebChannel* channel);
+#endif
+
private:
QQuickWebViewExperimental(QQuickWebView* webView, QQuickWebViewPrivate* webViewPrivate);
QQuickWebView* q_ptr;
@@ -401,6 +416,11 @@
QObject* schemeParent;
QWebKitTest* m_test;
+#ifdef HAVE_WEBCHANNEL
+ QQmlWebChannel* m_webChannel;
+ QWebChannelWebKitTransport* m_webChannelTransport;
+#endif
+
friend class WebKit::QtWebPageUIClient;
Q_DECLARE_PRIVATE(QQuickWebView)
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebKit2/UIProcess/API/qt/qquickwebview_p_p.h
^
|
@@ -55,6 +55,7 @@
class QWebNavigationHistory;
class QWebKitTest;
+class QWebChannelWebKitTransport;
QT_BEGIN_NAMESPACE
class QQmlComponent;
@@ -137,6 +138,9 @@
void handleDownloadRequest(WebKit::DownloadProxy*);
void didReceiveMessageFromNavigatorQtObject(WKStringRef message);
+#ifdef HAVE_WEBCHANNEL
+ void didReceiveMessageFromNavigatorQtWebChannelTransportObject(WKStringRef message);
+#endif
WebCore::CoordinatedGraphicsScene* coordinatedGraphicsScene();
float deviceScaleFactor();
|
[-]
[+]
|
Added |
qtwebkit-5.4.1.tar.xz/Source/WebKit2/UIProcess/API/qt/qwebchannelwebkittransport.cpp
^
|
@@ -0,0 +1,66 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Milian Wolff <milian.wolff@kdab.com>
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtWebChannel module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL21$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 or version 3 as published by the Free
+** Software Foundation and appearing in the file LICENSE.LGPLv21 and
+** LICENSE.LGPLv3 included in the packaging of this file. Please review the
+** following information to ensure the GNU Lesser General Public License
+** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qwebchannelwebkittransport_p.h"
+
+#include <QJsonObject>
+#include <QJsonDocument>
+
+#include "qquickwebview_p.h"
+
+QWebChannelWebKitTransport::QWebChannelWebKitTransport(QQuickWebViewExperimental* experimental)
+ : QWebChannelAbstractTransport(experimental)
+ , m_experimental(experimental)
+{
+}
+
+void QWebChannelWebKitTransport::sendMessage(const QJsonObject& message)
+{
+ const QByteArray data = QJsonDocument(message).toJson(QJsonDocument::Compact);
+ m_experimental->postQtWebChannelTransportMessage(data);
+}
+
+void QWebChannelWebKitTransport::receiveMessage(const QByteArray& message)
+{
+ QJsonParseError error;
+ const QJsonDocument doc = QJsonDocument::fromJson(message, &error);
+ if (error.error != QJsonParseError::NoError) {
+ qWarning() << "Failed to parse the client WebKit QWebChannel message as JSON: " << message
+ << "Error message is:" << error.errorString();
+ return;
+ } else if (!doc.isObject()) {
+ qWarning() << "Received WebKit QWebChannel message is not a JSON object: " << message;
+ return;
+ }
+ emit messageReceived(doc.object(), this);
+}
|
[-]
[+]
|
Added |
qtwebkit-5.4.1.tar.xz/Source/WebKit2/UIProcess/API/qt/qwebchannelwebkittransport_p.h
^
|
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Milian Wolff <milian.wolff@kdab.com>
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtWebChannel module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL21$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 or version 3 as published by the Free
+** Software Foundation and appearing in the file LICENSE.LGPLv21 and
+** LICENSE.LGPLv3 included in the packaging of this file. Please review the
+** following information to ensure the GNU Lesser General Public License
+** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QWEBCHANNELWEBKITTRANSPORT_H
+#define QWEBCHANNELWEBKITTRANSPORT_H
+
+#include <QtWebChannel/QWebChannelAbstractTransport>
+
+class QQuickWebViewExperimental;
+
+class QWebChannelWebKitTransport : public QWebChannelAbstractTransport
+{
+ Q_OBJECT
+public:
+ explicit QWebChannelWebKitTransport(QQuickWebViewExperimental* experimental);
+
+ void sendMessage(const QJsonObject& message) Q_DECL_OVERRIDE;
+
+ void receiveMessage(const QByteArray& message);
+
+private:
+ QQuickWebViewExperimental* m_experimental;
+};
+
+#endif // QWEBCHANNELWEBKITTRANSPORT_H
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebKit2/UIProcess/API/qt/qwebloadrequest.cpp
^
|
@@ -42,7 +42,7 @@
/*!
\qmltype WebLoadRequest
\instantiates QWebLoadRequest
- \inqmlmodule QtWebKit 3.0
+ \inqmlmodule QtWebKit
\brief A utility class for the WebView::loadingChanged signal.
|
[-]
[+]
|
Added |
qtwebkit-5.4.1.tar.xz/Source/WebKit2/UIProcess/API/qt/tests/qmltests/WebView/tst_webchannel.qml
^
|
@@ -0,0 +1,109 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Milian Wolff <milian.wolff@kdab.com>
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtWebChannel module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL21$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 or version 3 as published by the Free
+** Software Foundation and appearing in the file LICENSE.LGPLv21 and
+** LICENSE.LGPLv3 included in the packaging of this file. Please review the
+** following information to ensure the GNU Lesser General Public License
+** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import QtTest 1.0
+import QtWebKit 3.0
+import QtWebKit.experimental 1.0
+import "../common"
+
+import QtWebChannel 1.0
+
+Item {
+ id: test
+ signal barCalled(var arg)
+ signal clientInitializedCalled(var arg)
+
+ QtObject {
+ id: testObject
+ WebChannel.id: "testObject"
+
+ property var foo: 42
+
+ function clientInitialized(arg)
+ {
+ clientInitializedCalled(arg);
+ }
+
+ function bar(arg) {
+ barCalled(arg);
+ }
+
+ signal runTest(var foo)
+ }
+
+ TestWebView {
+ id: webView
+ experimental.windowObjects: [testObject]
+ experimental.preferences.developerExtrasEnabled: true
+ }
+
+ SignalSpy {
+ id: initializedSpy
+ target: test
+ signalName: "clientInitializedCalled"
+ }
+
+ SignalSpy {
+ id: barSpy
+ target: test
+ signalName: "barCalled"
+ }
+
+ TestCase {
+ name: "WebViewWebChannel"
+ property url testUrl: Qt.resolvedUrl("../common/webchannel.html")
+
+ function init() {
+ initializedSpy.clear();
+ barSpy.clear();
+ }
+
+ function test_basic() {
+ webView.url = testUrl;
+ verify(webView.waitForLoadSucceeded());
+
+ initializedSpy.wait();
+ compare(initializedSpy.signalArguments.length, 1);
+ compare(initializedSpy.signalArguments[0][0], 42);
+
+ var newValue = "roundtrip";
+ testObject.runTest(newValue);
+ barSpy.wait();
+ compare(barSpy.signalArguments.length, 1);
+ compare(barSpy.signalArguments[0][0], newValue);
+
+ compare(testObject.foo, newValue);
+ }
+ }
+}
|
[-]
[+]
|
Added |
qtwebkit-5.4.1.tar.xz/Source/WebKit2/UIProcess/API/qt/tests/qmltests/common/webchannel.html
^
|
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <script type="text/javascript" src="qrc:///qtwebchannel/qwebchannel.js"></script>
+ <script type="text/javascript">
+ //BEGIN SETUP
+ var channel = new QWebChannel(navigator.qtWebChannelTransport, function(channel) {
+ window.testObject = channel.objects.testObject;
+ testObject.runTest.connect(function(foo) {
+ testObject.foo = foo;
+ testObject.bar(foo);
+ });
+ testObject.clientInitialized(testObject.foo);
+ });
+ //END SETUP
+ </script>
+ </head>
+ <body>
+ </body>
+</html>
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebKit2/UIProcess/qt/QtWebContext.cpp
^
|
@@ -89,8 +89,14 @@
static void didReceiveMessageFromInjectedBundle(WKContextRef, WKStringRef messageName, WKTypeRef messageBody, const void*)
{
- if (!WKStringIsEqualToUTF8CString(messageName, "MessageFromNavigatorQtObject"))
+ if (!WKStringIsEqualToUTF8CString(messageName, "MessageFromNavigatorQtObject")
+#ifdef HAVE_WEBCHANNEL
+ && !WKStringIsEqualToUTF8CString(messageName, "MessageFromNavigatorQtWebChannelTransportObject")
+#endif
+ )
+ {
return;
+ }
ASSERT(messageBody);
ASSERT(WKGetTypeID(messageBody) == WKArrayGetTypeID());
@@ -103,7 +109,12 @@
WKPageRef page = static_cast<WKPageRef>(WKArrayGetItemAtIndex(body, 0));
WKStringRef str = static_cast<WKStringRef>(WKArrayGetItemAtIndex(body, 1));
- QQuickWebViewPrivate::get(page)->didReceiveMessageFromNavigatorQtObject(str);
+ if (WKStringIsEqualToUTF8CString(messageName, "MessageFromNavigatorQtObject"))
+ QQuickWebViewPrivate::get(page)->didReceiveMessageFromNavigatorQtObject(str);
+#ifdef HAVE_WEBCHANNEL
+ else if (WKStringIsEqualToUTF8CString(messageName, "MessageFromNavigatorQtWebChannelTransportObject"))
+ QQuickWebViewPrivate::get(page)->didReceiveMessageFromNavigatorQtWebChannelTransportObject(str);
+#endif
}
static void initializeContextInjectedBundleClient(WKContextRef context)
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebKit2/WebKit2.pri
^
|
@@ -80,7 +80,13 @@
LIBS += -lrt
}
-have?(QTQUICK): QT += qml quick
+have?(QTQUICK): {
+ QT += qml quick
+ qtHaveModule(webchannel) {
+ QT += webchannel
+ DEFINES += HAVE_WEBCHANNEL
+ }
+}
have?(qtpositioning):enable?(GEOLOCATION): QT += positioning
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h
^
|
@@ -192,7 +192,8 @@
VideoTrigger |
PluginTrigger|
CanvasTrigger |
- AnimationTrigger);
+ AnimationTrigger |
+ LargeAreaTrigger);
}
virtual bool layerTreeStateIsFrozen() const OVERRIDE;
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp
^
|
@@ -212,6 +212,8 @@
void CoordinatedLayerTreeHost::purgeBackingStores()
{
+ // Wait for CoordinatedGraphicsScene::setActive(true) to be called.
+ m_isWaitingForRenderer = true;
m_coordinator->purgeBackingStores();
}
@@ -401,8 +403,8 @@
if (m_layerFlushTimer.isActive())
return;
- m_layerFlushTimer.startOneShot(m_coordinator->nextAnimationServiceTime());
scheduleLayerFlush();
+ m_layerFlushTimer.startOneShot(m_coordinator->nextAnimationServiceTime());
}
#endif
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebKit2/WebProcess/qt/QtBuiltinBundle.cpp
^
|
@@ -93,6 +93,10 @@
handleMessageToNavigatorQtObject(page, messageBody);
else if (WKStringIsEqualToUTF8CString(messageName, "SetNavigatorQtObjectEnabled"))
handleSetNavigatorQtObjectEnabled(page, messageBody);
+#ifdef HAVE_WEBCHANNEL
+ else if (WKStringIsEqualToUTF8CString(messageName, "MessageToNavigatorQtWebChannelTransportObject"))
+ handleMessageToNavigatorQtWebChannelTransport(page, messageBody);
+#endif
}
void QtBuiltinBundle::handleMessageToNavigatorQtObject(WKBundlePageRef page, WKTypeRef messageBody)
@@ -119,4 +123,18 @@
bundlePage->setNavigatorQtObjectEnabled(enabled);
}
+#ifdef HAVE_WEBCHANNEL
+void QtBuiltinBundle::handleMessageToNavigatorQtWebChannelTransport(WKBundlePageRef page, WKTypeRef messageBody)
+{
+ ASSERT(messageBody);
+ ASSERT(WKGetTypeID(messageBody) == WKStringGetTypeID());
+ WKStringRef contents = static_cast<WKStringRef>(messageBody);
+
+ QtBuiltinBundlePage* bundlePage = m_pages.get(page);
+ if (!bundlePage)
+ return;
+ bundlePage->didReceiveMessageToNavigatorQtWebChannelTransport(contents);
+}
+#endif
+
} // namespace WebKit
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebKit2/WebProcess/qt/QtBuiltinBundle.h
^
|
@@ -57,6 +57,9 @@
private:
void handleMessageToNavigatorQtObject(WKBundlePageRef, WKTypeRef messageBody);
void handleSetNavigatorQtObjectEnabled(WKBundlePageRef, WKTypeRef messageBody);
+#ifdef HAVE_WEBCHANNEL
+ void handleMessageToNavigatorQtWebChannelTransport(WKBundlePageRef, WKTypeRef messageBody);
+#endif
HashMap<WKBundlePageRef, OwnPtr<QtBuiltinBundlePage> > m_pages;
WKBundleRef m_bundle;
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebKit2/WebProcess/qt/QtBuiltinBundlePage.cpp
^
|
@@ -39,11 +39,127 @@
namespace WebKit {
+typedef JSClassRef (*CreateClassRefCallback)();
+
+static void registerNavigatorObject(JSObjectRef *object, JSStringRef name,
+ JSGlobalContextRef context, void* data,
+ CreateClassRefCallback createClassRefCallback,
+ JSStringRef postMessageName, JSObjectCallAsFunctionCallback postMessageCallback)
+{
+ static JSStringRef navigatorName = JSStringCreateWithUTF8CString("navigator");
+
+ if (*object)
+ JSValueUnprotect(context, *object);
+ *object = JSObjectMake(context, createClassRefCallback(), data);
+ JSValueProtect(context, *object);
+
+ JSObjectRef postMessage = JSObjectMakeFunctionWithCallback(context, postMessageName, postMessageCallback);
+ JSObjectSetProperty(context, *object, postMessageName, postMessage, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly, 0);
+
+ JSValueRef navigatorValue = JSObjectGetProperty(context, JSContextGetGlobalObject(context), navigatorName, 0);
+ if (!JSValueIsObject(context, navigatorValue))
+ return;
+ JSObjectRef navigatorObject = JSValueToObject(context, navigatorValue, 0);
+ JSObjectSetProperty(context, navigatorObject, name, *object, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly, 0);
+}
+
+static JSClassRef createEmptyJSClassRef()
+{
+ const JSClassDefinition definition = kJSClassDefinitionEmpty;
+ return JSClassCreate(&definition);
+}
+
+static JSClassRef navigatorQtObjectClass()
+{
+ static JSClassRef classRef = createEmptyJSClassRef();
+ return classRef;
+}
+
+static JSValueRef qt_postMessageCallback(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef*)
+{
+ // FIXME: should it work regardless of the thisObject?
+
+ if (argumentCount < 1 || !JSValueIsString(context, arguments[0]))
+ return JSValueMakeUndefined(context);
+
+ QtBuiltinBundlePage* bundlePage = reinterpret_cast<QtBuiltinBundlePage*>(JSObjectGetPrivate(thisObject));
+ ASSERT(bundlePage);
+
+ // FIXME: needed?
+ if (!bundlePage->navigatorQtObjectEnabled())
+ return JSValueMakeUndefined(context);
+
+ JSRetainPtr<JSStringRef> jsContents = JSValueToStringCopy(context, arguments[0], 0);
+ WKRetainPtr<WKStringRef> contents(AdoptWK, WKStringCreateWithJSString(jsContents.get()));
+ bundlePage->postMessageFromNavigatorQtObject(contents.get());
+ return JSValueMakeUndefined(context);
+}
+
+static JSObjectRef createWrappedMessage(JSGlobalContextRef context, WKStringRef data)
+{
+ static JSStringRef dataName = JSStringCreateWithUTF8CString("data");
+
+ JSRetainPtr<JSStringRef> jsData = WKStringCopyJSString(data);
+ JSObjectRef wrappedMessage = JSObjectMake(context, 0, 0);
+ JSObjectSetProperty(context, wrappedMessage, dataName, JSValueMakeString(context, jsData.get()), kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly, 0);
+ return wrappedMessage;
+}
+
+static void callOnMessage(JSObjectRef object, WKStringRef contents, WKBundlePageRef page)
+{
+ static JSStringRef onmessageName = JSStringCreateWithUTF8CString("onmessage");
+
+ if (!object)
+ return;
+
+ WKBundleFrameRef frame = WKBundlePageGetMainFrame(page);
+ JSGlobalContextRef context = WKBundleFrameGetJavaScriptContext(frame);
+
+ JSValueRef onmessageValue = JSObjectGetProperty(context, object, onmessageName, 0);
+ if (!JSValueIsObject(context, onmessageValue))
+ return;
+
+ JSObjectRef onmessageFunction = JSValueToObject(context, onmessageValue, 0);
+ if (!JSObjectIsFunction(context, onmessageFunction))
+ return;
+
+ JSObjectRef wrappedMessage = createWrappedMessage(context, contents);
+ JSObjectCallAsFunction(context, onmessageFunction, 0, 1, &wrappedMessage, 0);
+}
+
+#ifdef HAVE_WEBCHANNEL
+static JSClassRef navigatorQtWebChannelTransportObjectClass()
+{
+ static JSClassRef classRef = createEmptyJSClassRef();
+ return classRef;
+}
+
+static JSValueRef qt_postWebChannelMessageCallback(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef*)
+{
+ // FIXME: should it work regardless of the thisObject?
+
+ if (argumentCount < 1 || !JSValueIsString(context, arguments[0]))
+ return JSValueMakeUndefined(context);
+
+ QtBuiltinBundlePage* bundlePage = reinterpret_cast<QtBuiltinBundlePage*>(JSObjectGetPrivate(thisObject));
+ ASSERT(bundlePage);
+
+ // TODO: can we transmit the data as JS object, instead of as a string?
+ JSRetainPtr<JSStringRef> jsContents = JSValueToStringCopy(context, arguments[0], 0);
+ WKRetainPtr<WKStringRef> contents(AdoptWK, WKStringCreateWithJSString(jsContents.get()));
+ bundlePage->postMessageFromNavigatorQtWebChannelTransport(contents.get());
+ return JSValueMakeUndefined(context);
+}
+#endif
+
QtBuiltinBundlePage::QtBuiltinBundlePage(QtBuiltinBundle* bundle, WKBundlePageRef page)
: m_bundle(bundle)
, m_page(page)
, m_navigatorQtObject(0)
, m_navigatorQtObjectEnabled(false)
+#ifdef HAVE_WEBCHANNEL
+ , m_navigatorQtWebChannelTransportObject(0)
+#endif
{
WKBundlePageLoaderClient loaderClient = {
kWKBundlePageLoaderClientCurrentVersion,
@@ -88,11 +204,25 @@
QtBuiltinBundlePage::~QtBuiltinBundlePage()
{
- if (!m_navigatorQtObject)
+ if (!m_navigatorQtObject
+#ifdef HAVE_WEBCHANNEL
+ && !m_navigatorQtWebChannelTransportObject
+#endif
+ )
+ {
return;
+ }
+
WKBundleFrameRef frame = WKBundlePageGetMainFrame(m_page);
JSGlobalContextRef context = WKBundleFrameGetJavaScriptContext(frame);
- JSValueUnprotect(context, m_navigatorQtObject);
+
+ if (m_navigatorQtObject)
+ JSValueUnprotect(context, m_navigatorQtObject);
+
+#ifdef HAVE_WEBCHANNEL
+ if (m_navigatorQtWebChannelTransportObject)
+ JSValueUnprotect(context, m_navigatorQtWebChannelTransportObject);
+#endif
}
void QtBuiltinBundlePage::didClearWindowForFrame(WKBundlePageRef page, WKBundleFrameRef frame, WKBundleScriptWorldRef world, const void* clientInfo)
@@ -100,72 +230,26 @@
static_cast<QtBuiltinBundlePage*>(const_cast<void*>(clientInfo))->didClearWindowForFrame(frame, world);
}
-static JSValueRef qt_postMessageCallback(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef*)
-{
- // FIXME: should it work regardless of the thisObject?
-
- if (argumentCount < 1 || !JSValueIsString(context, arguments[0]))
- return JSValueMakeUndefined(context);
-
- QtBuiltinBundlePage* bundlePage = reinterpret_cast<QtBuiltinBundlePage*>(JSObjectGetPrivate(thisObject));
- ASSERT(bundlePage);
-
- // FIXME: needed?
- if (!bundlePage->navigatorQtObjectEnabled())
- return JSValueMakeUndefined(context);
-
- JSRetainPtr<JSStringRef> jsContents = JSValueToStringCopy(context, arguments[0], 0);
- WKRetainPtr<WKStringRef> contents(AdoptWK, WKStringCreateWithJSString(jsContents.get()));
- bundlePage->postMessageFromNavigatorQtObject(contents.get());
- return JSValueMakeUndefined(context);
-}
-
void QtBuiltinBundlePage::didClearWindowForFrame(WKBundleFrameRef frame, WKBundleScriptWorldRef world)
{
if (!WKBundleFrameIsMainFrame(frame) || WKBundleScriptWorldNormalWorld() != world)
return;
JSGlobalContextRef context = WKBundleFrameGetJavaScriptContextForWorld(frame, world);
registerNavigatorQtObject(context);
+#ifdef HAVE_WEBCHANNEL
+ registerNavigatorQtWebChannelTransportObject(context);
+#endif
}
-void QtBuiltinBundlePage::postMessageFromNavigatorQtObject(WKStringRef contents)
+void QtBuiltinBundlePage::postMessageFromNavigatorQtObject(WKStringRef message)
{
static WKStringRef messageName = WKStringCreateWithUTF8CString("MessageFromNavigatorQtObject");
- WKTypeRef body[] = { page(), contents };
- WKRetainPtr<WKArrayRef> messageBody(AdoptWK, WKArrayCreate(body, sizeof(body) / sizeof(WKTypeRef)));
- WKBundlePostMessage(m_bundle->toRef(), messageName, messageBody.get());
-}
-
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/WebKit2/WebProcess/qt/QtBuiltinBundlePage.h
^
|
@@ -53,15 +53,26 @@
bool navigatorQtObjectEnabled() const { return m_navigatorQtObjectEnabled; }
void setNavigatorQtObjectEnabled(bool);
+#ifdef HAVE_WEBCHANNEL
+ void postMessageFromNavigatorQtWebChannelTransport(WKStringRef message);
+ void didReceiveMessageToNavigatorQtWebChannelTransport(WKStringRef message);
+#endif
+
private:
void registerNavigatorQtObject(JSGlobalContextRef);
+#ifdef HAVE_WEBCHANNEL
+ void registerNavigatorQtWebChannelTransportObject(JSGlobalContextRef);
+#endif
- static JSClassRef navigatorQtObjectClass();
+ void postNavigatorMessage(WKStringRef messageName, WKStringRef message);
QtBuiltinBundle* m_bundle;
WKBundlePageRef m_page;
JSObjectRef m_navigatorQtObject;
bool m_navigatorQtObjectEnabled;
+#ifdef HAVE_WEBCHANNEL
+ JSObjectRef m_navigatorQtWebChannelTransportObject;
+#endif
};
} // namespace WebKit
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/qtwebkit.qdocconf
^
|
@@ -2,7 +2,6 @@
project = QtWebKit
description = Qt WebKit Reference Documentation
-url = http://qt-project.org/doc/qt-$QT_VER
version = $QT_VERSION
# Defines the name of the project. You cannot use operators (+, =, -) in
@@ -27,7 +26,7 @@
qhp.QtWebKit.subprojects.classes.sortPages = true
qhp.QtWebKit.subprojects.qmltypes.title = QML Types
qhp.QtWebKit.subprojects.qmltypes.indexTitle = Qt WebKit QML Types
-qhp.QtWebKit.subprojects.qmltypes.selectors = fake:qmlclass
+qhp.QtWebKit.subprojects.qmltypes.selectors = qmlclass
qhp.QtWebKit.subprojects.qmltypes.sortPages = true
headerdirs = WebKit/qt/Api WebKit/qt/WidgetApi WebKit2/UIProcess/API/qt
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/sync.profile
^
|
@@ -24,4 +24,5 @@
"qtlocation" => "",
"qtmultimedia" => "",
"qtsensors" => "",
+ "qtwebchannel" => "",
);
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Source/widgetsapi.pri
^
|
@@ -45,7 +45,7 @@
use?(3D_GRAPHICS): WEBKIT += ANGLE
-WEBKIT += javascriptcore wtf webcore
+WEBKIT += javascriptcore wtf webcore webkit1
MODULE = webkitwidgets
CONFIG += creating_module
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Tools/QtTestBrowser/launcherwindow.cpp
^
|
@@ -175,8 +175,11 @@
WebViewGraphicsBased* view = new WebViewGraphicsBased(splitter);
m_view = view;
#ifndef QT_NO_OPENGL
- toggleQGLWidgetViewport(m_windowOptions.useQGLWidgetViewport);
+ if (!m_windowOptions.useQOpenGLWidgetViewport)
+ toggleQGLWidgetViewport(m_windowOptions.useQGLWidgetViewport);
#endif
+ if (!m_windowOptions.useQGLWidgetViewport)
+ toggleQOpenGLWidgetViewport(m_windowOptions.useQOpenGLWidgetViewport);
view->setPage(page());
connect(view, SIGNAL(currentFPSUpdated(int)), this, SLOT(updateFPS(int)));
@@ -379,8 +382,12 @@
QAction* toggleAcceleratedCompositing = graphicsViewMenu->addAction("Toggle Accelerated Compositing", this, SLOT(toggleAcceleratedCompositing(bool)));
toggleAcceleratedCompositing->setCheckable(true);
toggleAcceleratedCompositing->setChecked(settings->testAttribute(QWebSettings::AcceleratedCompositingEnabled));
- toggleAcceleratedCompositing->setEnabled(isGraphicsBased());
- toggleAcceleratedCompositing->connect(toggleGraphicsView, SIGNAL(toggled(bool)), SLOT(setEnabled(bool)));
+
+ QAction* toggleAccelerated2dCanvas = graphicsViewMenu->addAction("Toggle Accelerated 2D canvas", this, SLOT(toggleAccelerated2dCanvas(bool)));
+ toggleAccelerated2dCanvas->setCheckable(true);
+ toggleAccelerated2dCanvas->setEnabled(settings->testAttribute(QWebSettings::AcceleratedCompositingEnabled));
+ toggleAccelerated2dCanvas->setChecked(settings->testAttribute(QWebSettings::Accelerated2dCanvasEnabled));
+ toggleAccelerated2dCanvas->connect(toggleAcceleratedCompositing, SIGNAL(toggled(bool)), SLOT(setEnabled(bool)));
QAction* toggleResizesToContents = graphicsViewMenu->addAction("Toggle Resizes To Contents Mode", this, SLOT(toggleResizesToContents(bool)));
toggleResizesToContents->setCheckable(true);
@@ -401,6 +408,13 @@
toggleQGLWidgetViewport->setEnabled(isGraphicsBased());
toggleQGLWidgetViewport->connect(toggleGraphicsView, SIGNAL(toggled(bool)), SLOT(setEnabled(bool)));
#endif
+#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0)
+ QAction* toggleQOpenGLWidgetViewport = graphicsViewMenu->addAction("Toggle use of QOpenGLWidget Viewport", this, SLOT(toggleQOpenGLWidgetViewport(bool)));
+ toggleQOpenGLWidgetViewport->setCheckable(true);
+ toggleQOpenGLWidgetViewport->setChecked(m_windowOptions.useQOpenGLWidgetViewport);
+ toggleQOpenGLWidgetViewport->setEnabled(isGraphicsBased());
+ toggleQOpenGLWidgetViewport->connect(toggleGraphicsView, SIGNAL(toggled(bool)), SLOT(setEnabled(bool)));
+#endif
QMenu* viewportUpdateMenu = graphicsViewMenu->addMenu("Change Viewport Update Mode");
viewportUpdateMenu->setEnabled(isGraphicsBased());
@@ -786,8 +800,11 @@
#endif
#ifndef QT_NO_OPENGL
- toggleQGLWidgetViewport(m_windowOptions.useQGLWidgetViewport);
+ if (!m_windowOptions.useQOpenGLWidgetViewport)
+ toggleQGLWidgetViewport(m_windowOptions.useQGLWidgetViewport);
#endif
+ if (!m_windowOptions.useQGLWidgetViewport)
+ toggleQOpenGLWidgetViewport(m_windowOptions.useQOpenGLWidgetViewport);
}
void LauncherWindow::setEditable(bool on)
@@ -877,6 +894,11 @@
page()->settings()->setAttribute(QWebSettings::AcceleratedCompositingEnabled, toggle);
}
+void LauncherWindow::toggleAccelerated2dCanvas(bool toggle)
+{
+ page()->settings()->setAttribute(QWebSettings::Accelerated2dCanvasEnabled, toggle);
+}
+
void LauncherWindow::toggleTiledBackingStore(bool toggle)
{
page()->settings()->setAttribute(QWebSettings::TiledBackingStoreEnabled, toggle);
@@ -968,13 +990,30 @@
if (!isGraphicsBased())
return;
+ if (enable)
+ m_windowOptions.useQOpenGLWidgetViewport = false;
m_windowOptions.useQGLWidgetViewport = enable;
- WebViewGraphicsBased* view = static_cast<WebViewGraphicsBased*>(m_view);
+ WebViewGraphicsBased* view = static_cast<WebViewGraphicsBased*>(m_view);
view->setViewport(enable ? new QGLWidget() : 0);
}
#endif
+void LauncherWindow::toggleQOpenGLWidgetViewport(bool enable)
+{
+ if (!isGraphicsBased())
+ return;
+
+#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0)
+ if (enable)
+ m_windowOptions.useQGLWidgetViewport = false;
+ m_windowOptions.useQOpenGLWidgetViewport = enable;
+
+ WebViewGraphicsBased* view = static_cast<WebViewGraphicsBased*>(m_view);
+ view->setViewport(enable ? new QOpenGLWidget() : 0);
+#endif
+}
+
void LauncherWindow::changeViewportUpdateMode(int mode)
{
m_windowOptions.viewportUpdateMode = QGraphicsView::ViewportUpdateMode(mode);
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Tools/QtTestBrowser/launcherwindow.h
^
|
@@ -38,6 +38,9 @@
#ifndef QT_NO_OPENGL
#include <QtOpenGL/QGLWidget>
#endif
+#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0)
+#include <QOpenGLWidget>
+#endif
#include <QDebug>
@@ -82,9 +85,8 @@
, useDiskCookies(true)
, enableScrollAnimator(false)
, offlineStorageDefaultQuotaSize(0)
-#ifndef QT_NO_OPENGL
, useQGLWidgetViewport(false)
-#endif
+ , useQOpenGLWidgetViewport(false)
, printLoadedUrls(false)
, startMaximized(false)
{
@@ -107,9 +109,8 @@
bool useDiskCookies;
bool enableScrollAnimator;
quint64 offlineStorageDefaultQuotaSize;
-#ifndef QT_NO_OPENGL
bool useQGLWidgetViewport;
-#endif
+ bool useQOpenGLWidgetViewport;
bool printLoadedUrls;
QUrl inspectorUrl;
quint16 remoteInspectorPort;
@@ -153,6 +154,7 @@
void setTouchMocking(bool on);
void toggleWebView(bool graphicsBased);
void toggleAcceleratedCompositing(bool toggle);
+ void toggleAccelerated2dCanvas(bool toggle);
void toggleTiledBackingStore(bool toggle);
void toggleResizesToContents(bool toggle);
void toggleWebGL(bool toggle);
@@ -179,6 +181,7 @@
#ifndef QT_NO_OPENGL
void toggleQGLWidgetViewport(bool enable);
#endif
+ void toggleQOpenGLWidgetViewport(bool enable);
void changeViewportUpdateMode(int mode);
void animatedFlip();
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Tools/QtTestBrowser/qttestbrowser.cpp
^
|
@@ -31,11 +31,16 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include "config.h"
+
#include "DumpRenderTreeSupportQt.h"
-#include "QtTestSupport.h"
#include "launcherwindow.h"
#include "urlloader.h"
+#if HAVE(QTTESTSUPPORT)
+#include "QtTestSupport.h"
+#endif
+
WindowOptions windowOptions;
#include <QApplication>
@@ -128,8 +133,9 @@
<< "[-no-compositing]"
#if defined(QT_CONFIGURED_WITH_OPENGL)
<< "[-gl-viewport]"
- << "[-webgl]"
#endif
+ << "[-opengl-viewport]"
+ << "[-webgl]"
<< QString("[-viewport-update-mode %1]").arg(formatKeys(updateModes)).toLatin1().data()
#if !defined(QT_NO_NETWORKDISKCACHE) && !defined(QT_NO_DESKTOPSERVICES)
<< "[-disk-cache]"
@@ -148,7 +154,9 @@
<< "[-offline-storage-database-enabled]"
<< "[-offline-web-application-cache-enabled]"
<< "[-set-offline-storage-default-quota maxSize]"
+#if HAVE(QTTESTSUPPORT)
<< "[-use-test-fonts]"
+#endif
<< "[-print-loaded-urls]"
<< "URLs";
appQuit(0);
@@ -159,7 +167,6 @@
windowOptions.useGraphicsView = true;
if (args.contains("-no-compositing")) {
- requiresGraphicsView("-no-compositing");
windowOptions.useCompositing = false;
}
@@ -235,14 +242,20 @@
windowOptions.useQGLWidgetViewport = true;
}
+#endif
if (args.contains("-webgl")) {
- requiresGraphicsView("-webgl");
windowOptions.useWebGL = true;
}
-#endif
+ if (args.contains("-opengl-viewport")) {
+ requiresGraphicsView("-opengl-viewport");
+ windowOptions.useQOpenGLWidgetViewport = true;
+ }
+
+#if HAVE(QTTESTSUPPORT)
if (args.contains("-use-test-fonts"))
WebKit::QtTestSupport::initializeTestFonts();
+#endif
if (args.contains("-print-loaded-urls"))
windowOptions.printLoadedUrls = true;
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Tools/WebKitTestRunner/Target.pri
^
|
@@ -42,8 +42,4 @@
$${ROOT_WEBKIT_DIR}/Source/WebCore/platform/qt \
$${ROOT_WEBKIT_DIR}/Tools/DumpRenderTree/qt
-PREFIX_HEADER = WebKitTestRunnerPrefix.h
-*-g++*:QMAKE_CXXFLAGS += "-include $$PREFIX_HEADER"
-*-clang*:QMAKE_CXXFLAGS += "-include $$PREFIX_HEADER"
-
RESOURCES = qt/WebKitTestRunner.qrc
|
[-]
[+]
|
Added |
qtwebkit-5.4.1.tar.xz/Tools/qmake/config.tests/icu
^
|
+(directory)
|
[-]
[+]
|
Added |
qtwebkit-5.4.1.tar.xz/Tools/qmake/config.tests/icu/icu.cpp
^
|
@@ -0,0 +1,46 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the config.tests of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL21$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 or version 3 as published by the Free
+** Software Foundation and appearing in the file LICENSE.LGPLv21 and
+** LICENSE.LGPLv3 included in the packaging of this file. Please review the
+** following information to ensure the GNU Lesser General Public License
+** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <unicode/utypes.h>
+#include <unicode/ucol.h>
+#include <unicode/ustring.h>
+
+int main(int, char **)
+{
+ UErrorCode status = U_ZERO_ERROR;
+ UCollator *collator = ucol_open("ru_RU", &status);
+ if (U_FAILURE(status))
+ return 0;
+ ucol_close(collator);
+ return 0;
+}
|
[-]
[+]
|
Added |
qtwebkit-5.4.1.tar.xz/Tools/qmake/config.tests/icu/icu.pro
^
|
@@ -0,0 +1,21 @@
+SOURCES = icu.cpp
+CONFIG += console
+CONFIG -= qt dylib
+
+win32 {
+ CONFIG(static, static|shared) {
+ CONFIG(debug, debug|release) {
+ LIBS += -lsicuind -lsicuucd -lsicudtd
+ } else {
+ LIBS += -lsicuin -lsicuuc -lsicudt
+ }
+ } else {
+ LIBS += -licuin -licuuc -licudt
+ }
+} else:!contains(QT_CONFIG,no-pkg-config):packagesExist("icu-i18n") {
+ PKGCONFIG += icu-i18n
+} else {
+ LIBS += -licui18n -licuuc -licudata
+}
+
+load(qt_build_config)
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Tools/qmake/config.tests/leveldb/leveldb.pro
^
|
@@ -1,3 +1,5 @@
SOURCES = leveldb.cpp
OBJECTS_DIR = obj
LIBS += -lleveldb -lmemenv
+
+load(qt_build_config)
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Tools/qmake/config.tests/libwebp/libwebp.pro
^
|
@@ -1,3 +1,5 @@
SOURCES = libwebp.cpp
OBJECTS_DIR = obj
LIBS += -lwebp
+
+load(qt_build_config)
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Tools/qmake/mkspecs/features/configure.prf
^
|
@@ -85,9 +85,6 @@
# command line options
defineTest(finalizeConfigure) {
- # Sanitize clashing options
- santizeFeatures()
-
# Sanitize build options
!qtHaveModule(testlib) {
CONFIGURE_WARNINGS += "Missing QtTest module, disabling DumpRenderTree, WebKitTestRunner and tests"
@@ -109,14 +106,17 @@
WEBKIT_CONFIG -= build_webkit2 build_minibrowser build_wtr
}
+ # Sanitize clashing options
+ santizeFeatures()
+
print_defaults {
log(DEFINES: $$configDefines()$${EOL})
error(Done computing defaults)
}
# Sanity checks that would prevent us from building the whole project altogether.
- !mac:!contains(QT_CONFIG,icu) {
- addReasonForSkippingBuild("ICU is required. To build QtWebKit with Qt 5 you need to build Qt 5 with libICU support. Check for ICU support being mentioned in qtbase/config.summary.")
+ !android:!mac:!config_icu {
+ addReasonForSkippingBuild("ICU is required.")
}
production_build:blackberry|qnx {
addReasonForSkippingBuild("Build not supported on BB10/QNX yet.")
@@ -124,6 +124,7 @@
!gnu_thin_archives:contains(QT_CONFIG, static) {
addReasonForSkippingBuild("QtWebKit cannot be built as a static library on this platform. Check your configuration in qtbase/config.summary.")
}
+ winrt: addReasonForSkippingBuild("QtWebKit is not supported on Windows Phone/Windows RT")
requiredPrograms = gperf python perl bison ruby flex
for(program, requiredPrograms): \
!programExistsInPath($$program): \
@@ -219,10 +220,9 @@
log($${EOL}Final configuration:$${EOL}$${EOL})
- debug: buildConfig += debug
- release: buildConfig += release
- buildConfig = $$join(buildConfig,/,,)
- debug:release:debug_and_release:buildConfig += (combined)
+ debug:release:debug_and_release: buildConfig = debug+release
+ else: CONFIG(debug, debug|release): buildConfig = debug
+ else: buildConfig = release
log(Build ......................... $$build$${EOL})
log(Configuration ................. $$buildConfig$${EOL})
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Tools/qmake/mkspecs/features/default_post.prf
^
|
@@ -13,7 +13,7 @@
# Enable dynamic instead of static libraries for development
# Avoid it with debug_and_release, it can cause the application to load both the debug and release
# dependent libraries when using frameworks on Mac.
-!production_build:!debug_and_release:!buildbot:!win*:!build?(webkit2): CONFIG += force_static_libs_as_shared
+!production_build:!debug_and_release:!buildbot:!win*: CONFIG += force_static_libs_as_shared
# Don't create .prl files for intermediate libraries because their contents get used when linking against
# them, breaking "-Wl,-whole-archive -lMyIntermediateLib --Wl,-no-whole-archive"
@@ -48,16 +48,16 @@
INCLUDEPATH += \
$${ROOT_WEBKIT_DIR}/Source \
- $${ROOT_BUILD_DIR}/Source/include \
- $${QT.script.includes}
+ $${ROOT_BUILD_DIR}/Source/include
CONFIG -= warn_on
+gcc: QMAKE_CXXFLAGS += -fno-strict-aliasing
+
!compiling_thirdparty_code:*-g++*: QMAKE_CXXFLAGS = \
-Wall \
-Wextra \
-Wreturn-type \
- -fno-strict-aliasing \
-Wchar-subscripts \
-Wformat-security \
-Wreturn-type \
@@ -91,7 +91,7 @@
# on Linux and Mac OS X. On Windows we do have a convenience copy in
# Qt5's top-level repository, so let's add that to the PATH if we can
# find it.
- win32 {
+ equals(QMAKE_HOST.os, Windows) {
GNUTOOLS_DIR=$$[QT_HOST_DATA]/../gnuwin32/bin
exists($$GNUTOOLS_DIR/gperf.exe) {
GNUTOOLS = "(set $$escape_expand(\\\")PATH=$$toSystemPath($$GNUTOOLS_DIR);%PATH%$$escape_expand(\\\"))"
@@ -158,7 +158,7 @@
}
}
-contains(QT, webkit)|contains(QT, webkitwidgets) {
+contains(QT, webkit)|contains(QT, webkitwidgets):!isEqual(MODULE, webkitwidgets): {
# In addition to the main shared QtWebKit library we also
# need to link to any intermediate shared libraries.
force_static_libs_as_shared {
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Tools/qmake/mkspecs/features/default_pre.prf
^
|
@@ -106,7 +106,7 @@
# A newer version of flex is required on Windows. At the moment the only
# one that appears to provide binaries and is not cygwin is winflex.
FLEX = flex
-win32: FLEX = win_flex
+equals(QMAKE_HOST.os, Windows): FLEX = win_flex
BIN_EXTENSION =
win32: BIN_EXTENSION = .exe
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Tools/qmake/mkspecs/features/features.prf
^
|
@@ -95,6 +95,9 @@
# WebGL support - only enabled if we can use 3D graphics
use?(3d_graphics): WEBKIT_CONFIG += webgl
+ # Both desktop and GLES2 support (only on Windows at this point)
+ contains(QT_CONFIG, dynamicgl): WEBKIT_CONFIG += have_dynamicgl
+
# HTML5 Media Support for builds with GStreamer
unix:!mac:!contains(QT_CONFIG, no-pkg-config) {
packagesExist("glib-2.0 gio-2.0 gstreamer-1.0 gstreamer-plugins-base-1.0") {
@@ -126,7 +129,8 @@
# Support for Graphics Surface
# GraphicsSurface requires GraphicsContext3D and hence use_3d_graphics
- use?(3d_graphics) {
+ # FIXME: GraphicsSurface do not work with dynamicgl at this point.
+ use?(3d_graphics):!have?(dynamicgl) {
mac: WEBKIT_CONFIG += use_graphics_surface
win32:contains(QT_CONFIG, opengles2): WEBKIT_CONFIG += use_graphics_surface
have?(glx):have?(xcomposite):have?(xrender): WEBKIT_CONFIG += use_graphics_surface use_glx
@@ -138,6 +142,8 @@
# IndexedDB requires leveldb
enable?(indexed_database): WEBKIT_CONFIG += use_leveldb
+ !config_icu:!mac: WEBKIT_CONFIG += use_wchar_unicode
+
export(WEBKIT_CONFIG)
export(CONFIGURE_WARNINGS)
}
@@ -172,8 +178,11 @@
# VideoTrack requires video
!enable?(video): WEBKIT_CONFIG -= video_track
- # Minibrowser must be able to query for QtTestSupport
+ # QtTestBrowser and MiniBrowser must be able to query for QtTestSupport
build?(qttestsupport): WEBKIT_CONFIG += have_qttestsupport
+ # Accelerated 2D canvas uses 3D graphics support.
+ !use?(3d_graphics): WEBKIT_CONFIG -= accelerated_2d_canvas
+
export(WEBKIT_CONFIG)
}
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Tools/qmake/mkspecs/features/features.pri
^
|
@@ -14,7 +14,7 @@
FEATURE_DEFAULTS = \
ENABLE_3D_RENDERING=1 \
- ENABLE_ACCELERATED_2D_CANVAS=0 \
+ ENABLE_ACCELERATED_2D_CANVAS=1 \
ENABLE_BATTERY_STATUS=0 \
ENABLE_BLOB=1 \
ENABLE_CANVAS_PATH=1 \
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Tools/qmake/mkspecs/features/functions.prf
^
|
@@ -196,7 +196,7 @@
}
defineTest(programExistsInPath) {
- win32: program = $${1}.exe
+ equals(QMAKE_HOST.os, Windows): program = $${1}.exe
else: program = $$1
PATH = "$$(PATH)"
|
[-]
[+]
|
Changed |
qtwebkit-5.4.1.tar.xz/Tools/qmake/mkspecs/features/unix/default_post.prf
^
|
@@ -13,8 +13,8 @@
# See https://bugs.webkit.org/show_bug.cgi?id=52810#c39 for details.
linux-g++*:isEqual(QT_ARCH,i386) {
!production_build {
- QMAKE_CFLAGS += -march=pentium4 -msse2 -mfpmath=sse
- QMAKE_CXXFLAGS += -march=pentium4 -msse2 -mfpmath=sse
+ QMAKE_CFLAGS += -msse2 -mfpmath=sse
+ QMAKE_CXXFLAGS += -msse2 -mfpmath=sse
}
}
@@ -23,7 +23,6 @@
greaterThan(QT_GCC_MAJOR_VERSION, 4)|greaterThan(QT_GCC_MINOR_VERSION, 7) {
QMAKE_CXXFLAGS_DEBUG += -fdebug-types-section
QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO += -fdebug-types-section
- separate_debug_info: QMAKE_CXXFLAGS_RELEASE += -fdebug-types-section
QMAKE_LFLAGS += -fdebug-types-section
} else {
# If DWARF-2 is desired -feliminate-dwarf2-dups can be used with GCC 4.7,
@@ -32,10 +31,8 @@
QMAKE_CXXFLAGS_DEBUG += -gstabs
QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO -= -g
QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO += -gstabs
- separate_debug_info {
- QMAKE_CXXFLAGS_RELEASE -= -g
- QMAKE_CXXFLAGS_RELEASE += -gstabs
- }
+ # Don't use the gold linker with stabs, it uses more memory and produces larger debug binaries.
+ CONFIG -= use_gold_linker
}
}
@@ -43,6 +40,10 @@
!production_build {
# Treat warnings as errors on x86/Linux/GCC
isEqual(QT_ARCH,x86_64)|isEqual(QT_ARCH,i386): QMAKE_CXXFLAGS += -Werror
+ greaterThan(QT_GCC_MAJOR_VERSION, 4)|greaterThan(QT_GCC_MINOR_VERSION, 5) {
+ # Newer versions of GCC suggests noreturn at seemingly random
+ QMAKE_CXXFLAGS += -Wno-suggest-attribute=noreturn
+ }
}
}
@@ -62,7 +63,7 @@
contains(TEMPLATE, app): CONFIG += rpath
-CONFIG(debug, debug|release)|force_debug_info|separate_debug_info {
+CONFIG(debug, debug|release)|force_debug_info {
# Make ld not cache the symbol tables of input files in memory to avoid memory exhaustion during the linking phase.
!force_static_libs_as_shared:config_gnuld: QMAKE_LFLAGS += -Wl,--no-keep-memory
}
|
[-]
[+]
|
Added |
qtwebkit-5.4.1.tar.xz/dist
^
|
+(directory)
|
[-]
[+]
|
Added |
qtwebkit-5.4.1.tar.xz/dist/changes-5.4.0
^
|
@@ -0,0 +1,56 @@
+Qt 5.4 introduces many new features and improvements as well as bugfixes
+over the 5.3.x series. For more details, refer to the online documentation
+included in this distribution. The documentation is also available online:
+
+ http://qt-project.org/doc/qt-5.4
+
+The Qt version 5.4 series is binary compatible with the 5.3.x series.
+Applications compiled for 5.3 will continue to run with 5.4.
+
+Some of the changes listed in this file include issue tracking numbers
+corresponding to tasks in the Qt Bug Tracker:
+
+ http://bugreports.qt-project.org/
+
+Each of these identifiers can be entered in the bug tracker to obtain more
+information about a particular change.
+
+****************************************************************************
+* Library *
+****************************************************************************
+
+QtWebkit
+--------
+
+ - The Qt WebKit module is considered done. Users should consider migrating to Qt WebEngine to keep up with new web features.
+ - [QTBUG-41877] Fixed regression causing network crashes on high bandwidth websites.
+
+
+QtWebkitWidgets
+---------------
+
+ - Accelerated compositing is now also supported with a QOpenGLWidget as the viewport.
+ - Accelerated 2D Canvas can now be activated to make HTML canvas elements render using the OpenGL painter.
+
+QtWebkitQML
+-----------
+
+ - Integration with QWebChannel.
+
+
+****************************************************************************
+* Platform Specific Changes *
+****************************************************************************
+
+Windows
+-------
+
+ - Support for dynamic GL builds.
+ - [QTBUG-42417] Fixed occational crashes in Windows 64-bit JavaScript JIT.
+
+
+Machine architectures
+---------------------
+
+ - [QTBUG-41896] Fixed common JavaScript crashes on big-endian architectures.
+ - [QTBUG-35681] Low level interpreter is now enabled on softfp ARM ABI if VFP is available.
|