In the course of developing and porting Adobe Photoshop, a package for editing images, Adobe engineers have learned a number of lessons.
When Photoshop was conceived in 1988, the Mac was the only affordable desktop system with the needed horsepower. Adobe developed the application in MacApp, an object-oriented framework using Object Pascal. At that time, Windows was not a significant factor for graphics applications, and the Mac was clearly the platform of choice for graphics and desktop publishing.
By late 1990, it was clear that the Windows platform would become a major market, and Adobe began planning its first Windows port. The company faced a difficult task. Understandably, it had not taken enough of the precautionary and preparatory steps that are routine today. Adobe ha
d created a base of source code for which there were very few tools. Windows compilers existed for C, C++, and Pascal, but not for Object Pascal, which was little known outside of Apple.
MacApp itself presented a serious porting challenge. To port Photoshop, not only the application code would have to move but also the entire MacApp framework.
While planning this first Windows port, Adobe was also mapping out new features for the next major upgrade. Clearly, if Adobe engineers opted to take a "snapshot" of the existing Photoshop code and then embark on a complex port to Windows while simultaneously bringing major new features to the Mac side, the two versions would be hopelessly out of sync.
Still, market conditions favored the snapshot approach. No one was certain that Windows would become a popular, viable platform for graphics and desktop publishing software. And it seemed unwise to tie up the highly successful Mac version of Photoshop while engineers reworked the application to sustai
n future cross-platform development efforts.
Emulating MacApp
In the end, Adobe opted for a sustained approach, hoping to avoid an endless pattern of releasing different platform versions with leapfrogging feature sets. Adobe decided to do a bulk translation of Photoshop from Object Pascal to C++ and to restructure the application into separate core and edge code. It would also create its own framework for Windows that emulated MacApp.
The first step was to form separate Mac and Windows development teams. Engineers on the Mac side would restructure the product to separate core code and API-related code. They would use MacApp 3.0, written in C++. Their goal was not to port code but to structure it properly. At the same time, the Mac team was working on new features for the next major revision.
Meanwhile, the Windows team began building an emulation of MacApp. They looked at the existing Photoshop and emulated only the required portions of MacApp--those relating to the user interface. Th
eir goal was to bring MacApp functionality to Windows and thus ensure that Mac code would compile under Windows.
At that time, it was unclear whether the Windows team would be licensed to use MacApp source code, so they worked without it, using headers that described the MacApp API and building their own analogs. As a result of their efforts, it is possible, using emulated portions of MacApp, to translate the Mac GUI into a Windows GUI. Adobe developed its own tool that converts Mac view resources--which describe interface elements such as dialog boxes and buttons--for use by the emulated MacApp.
This effort was so successful that, to this day, as Adobe's developers continue to improve Photoshop, their code for new features usually compiles without modification under either platform. Aside from the usual compiler independence issues, little hampers this process. Now, when developers complete new Photoshop features for either platform, the same features can be running on the other platform in sho
rt order. Mac and Windows versions of Photoshop ship within weeks of each other.
New Platforms--Unix, PowerPC, and NT
Encouraged by the successful Windows port and market forces, Adobe decided to develop Unix versions of Photoshop, including Sun Microsystems and Silicon Graphics. By leveraging fast I/O bandwidth and RISC processors, Photoshop will get a big performance boost.
To bring Photoshop to Unix platforms, Adobe is using Latitude, an emulated API system from Quorum Software Systems. Because the Quorum system emulates the Macintosh API, MacApp ported directly. A high percentage of Photoshop's Mac source code, running against Latitude's Unix libraries, has compiled without change.
Adobe is currently porting Photoshop to the PowerPC Mac and Windows NT. While it is too early to discuss either port in much detail, the basic approaches are clear.
In porting Photoshop to the PowerPC, the quirks of MacApp proved to be the major obstacle. Apple's compilers for the PowerPC, which w
ere written by IBM, were not geared to certain peculiarities of Object Pascal. For example, one involves the use of objects based on handles rather than pointers--a distinctive aspect of Macintosh memory management. Supporting such Object Pascal-based objects and calling sequences was too much for the PowerPC compiler. To get around this, Adobe and Apple jointly developed a new version of MacApp that compiles under PowerPC.
PowerPC and NT bring important changes to APIs and raise the usual issues of compiler independence. With NT, for example, the target machine may be using any of a number of different processors from Intel, Mips, and DEC.
NT brings important benefits to applications like Photoshop. For example, image-processing applications need large data structures. To run under Windows, these had to be broken into 64-KB units--a requirement that NT eliminates because it relies on a 32-bit flat-memory model, just like the Mac. Thus, NT removes the performance constraints that compromise the
performance of Photoshop under Windows.
It turns out that, with the MacApp emulation well established on the Windows side, the Photoshop Windows source code contains no attributes that do not easily compile. Therefore, the Adobe team was able to move Photoshop easily to NT.
Photograph: Doug Olson (lower left) with Adobe Photoshop team members.
Screens: Windows menu
Mac menu
The screens show how well the Windows and Mac versions of Photoshop correspond.