forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change PlatformBitmap memory ownership story. Fix CopyFromBackingStor…
…e threading issues. PlatformBitmap: restructure this class so that, on all platforms, it is safe to use an SkBitmap derived from the PlatformBitmap even after the PlatformBitmap is destroyed. In practice this means changes to Linux (use a different cairo creation routine that allows us to allocate the memory) and Windows (the HDC is owned by PlatformBitmap, the HBITMAP by the SkPixelRef). CopyFromBackingStore: instead of requiring the caller to provide a PlatformBitmap, modify the signature so that the completion callback accepts an SkBitmap. Sometimes, the backing store copiers will allocate a PlatformBitmap and pass its SkBitmap to the completion callback, but this becomes merely an implementation detail. Meanwhile, in the accelerated case, it is not at all necessary to allocate a PlatformBitmap, so don't. This fixes a bug on Linux where the cairo surface context was being freed on a thread other than the UI thread. PlatformBitmap is basically not thread safe on Linux, and this change fixes that. Also fixed is a Dr. Memory GDI usage warning -- we are sure to de-select the HBITMAP before deleting the memory DC. Lastly, moving CopyFromBackingStore's interface to use a callee-managed SkBitmap conditions the architecture for doing RGBA->YUV on the GPU, prior to readback. BUG=109963,159234,161537 Review URL: https://codereview.chromium.org/12087016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@180271 0039d316-1c4b-4281-b951-d872f2087c98
- Loading branch information
nick@chromium.org
committed
Feb 2, 2013
1 parent
89ae13e
commit d748d0f
Showing
38 changed files
with
366 additions
and
280 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.