aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkBitmap.cpp
Commit message (Collapse)AuthorAge
* Fix a bunch of warnings, mainly around rowBytes.Gravatar scroggo@google.com2013-02-25
| | | | | | | | | | | My recent change changed the way SkBitmap::fRowBytes is stored, and parameter/return values referring to rowBytes were changed to type size_t. Change the storage back, and eliminate warnings resulting from returning a size_t. Review URL: https://codereview.appspot.com/7396059 git-svn-id: http://skia.googlecode.com/svn/trunk@7855 2bbb7eff-a529-9590-31e7-b0007b416f81
* Use size_t for rowBytes.Gravatar scroggo@google.com2013-02-25
| | | | | | | | | | | | | Previously, we were using uint32_t sometimes, int sometimes, and size_t sometimes. Switch to using size_t, since we are actually talking about a number of bytes. In copyPixelsTo, use 0 as a flag to use the internal rowBytes, which is more consistent with setConfig. Review URL: https://codereview.appspot.com/7370047 git-svn-id: http://skia.googlecode.com/svn/trunk@7843 2bbb7eff-a529-9590-31e7-b0007b416f81
* Implement support for origin-TopLeft render targets in GL backend.Gravatar scroggo@google.com2013-02-05
| | | | | | | | | | Committed: https://code.google.com/p/skia/source/detail?r=7545 Reverted in r7571; re-opening. Review URL: https://codereview.appspot.com/7230049 git-svn-id: http://skia.googlecode.com/svn/trunk@7592 2bbb7eff-a529-9590-31e7-b0007b416f81
* Sanitizing source files in Skia_Periodic_House_KeepingGravatar skia.committer@gmail.com2013-01-26
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@7406 2bbb7eff-a529-9590-31e7-b0007b416f81
* Added print out of SkShader information to debuggerGravatar robertphillips@google.com2013-01-15
| | | | | | | | https://codereview.appspot.com/7105045/ git-svn-id: http://skia.googlecode.com/svn/trunk@7201 2bbb7eff-a529-9590-31e7-b0007b416f81
* fix warningsGravatar reed@google.com2013-01-07
| | | | | | Review URL: https://codereview.appspot.com/7073044 git-svn-id: http://skia.googlecode.com/svn/trunk@7064 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fix some extract subset bugs.Gravatar scroggo@google.com2012-12-07
| | | | | | | | | | | | | | | | | | | | | | In SkBitmap::extractSubset, perform a deepCopy, if the pixelRef supports it. Fixes a bug in the 'extractbitmap' gm, which attempts to draw a subset of a texture backed bitmap (if the canvas is really an SkGpuCanvas). Also fix some bugs that happen when there is a pixel offset. These fixes get bypassed by the deepCopy, but a user can still set a pixel offset manually. When copying GPU backed bitmap with a pixel offset, copy the offset. If the new config is the same as the old, copy fRowBytes as well. Add a function to SkBitmap.cpp (getUpperLeftFromOffset) to find the x,y coordinate to use when copying to a new config. Fix a bug where readPixels copied to the correct desired config and we were setting the generation ID to match even though the desired config was not the same as the original config (caught by my new tests!). Add some tests to verify the correct behavior. Review URL: https://codereview.appspot.com/6839043 git-svn-id: http://skia.googlecode.com/svn/trunk@6710 2bbb7eff-a529-9590-31e7-b0007b416f81
* Defining new color constat for transparent colorGravatar junov@google.com2012-12-06
| | | | | | Review URL: https://codereview.appspot.com/6901044 git-svn-id: http://skia.googlecode.com/svn/trunk@6696 2bbb7eff-a529-9590-31e7-b0007b416f81
* CG imagedecoder never sets isOpaque, so add method to SkBitmap to compute that,Gravatar reed@google.com2012-11-07
| | | | | | | and call it from CG imagedecoder. Review URL: https://codereview.appspot.com/6816101 git-svn-id: http://skia.googlecode.com/svn/trunk@6334 2bbb7eff-a529-9590-31e7-b0007b416f81
* Remove SK_DISABLE_EXTRACTSUBSET_OPAQUE_FIX test since it has been rebaselined.Gravatar bungeman@google.com2012-10-25
| | | | | | | https://codereview.appspot.com/6778044/ git-svn-id: http://skia.googlecode.com/svn/trunk@6111 2bbb7eff-a529-9590-31e7-b0007b416f81
* #define SK_DISABLE_EXTRACTSUBSET_OPAQUE_FIX to keep old, slow, non-opaque ↵Gravatar reed@google.com2012-10-15
| | | | | | | | | | | | | | | behavior in SkBitmap::extractSubset. This will allow chrome to keep this behavior until we can fix the callers in PNG and WEBP image decoders, that are incorrectly marking partially-loaded images as opaque (which they aren't, since they have undecoded pixels, which need to be transparent). git-svn-id: http://skia.googlecode.com/svn/trunk@5949 2bbb7eff-a529-9590-31e7-b0007b416f81
* Revert r3219. r3219 was a revert of r3036. r3036 made extractSubset copy the ↵Gravatar bsalomon@google.com2012-10-12
| | | | | | | | | | | | opaque bit but was reverted because of a partally-loaded jpeg issue in WK which has since been fixed: https://bugs.webkit.org/show_bug.cgi?id=78239 Related chrome bug: http://code.google.com/p/chromium/issues/detail?id=114107 git-svn-id: http://skia.googlecode.com/svn/trunk@5911 2bbb7eff-a529-9590-31e7-b0007b416f81
* Addressed xcode analysis complaintsGravatar robertphillips@google.com2012-09-24
| | | | | | | | http://codereview.appspot.com/6558048/ git-svn-id: http://skia.googlecode.com/svn/trunk@5646 2bbb7eff-a529-9590-31e7-b0007b416f81
* Result of running tools/sanitize_source_files.py (which was added in ↵Gravatar rmistry@google.com2012-08-23
| | | | | | | | | https://codereview.appspot.com/6465078/) This CL is part I of IV (I broke down the 1280 files into 4 CLs). Review URL: https://codereview.appspot.com/6485054 git-svn-id: http://skia.googlecode.com/svn/trunk@5262 2bbb7eff-a529-9590-31e7-b0007b416f81
* When copying a bitmap, copy the generation ID.Gravatar scroggo@google.com2012-08-22
| | | | | | Review URL: https://codereview.appspot.com/6462084 git-svn-id: http://skia.googlecode.com/svn/trunk@5227 2bbb7eff-a529-9590-31e7-b0007b416f81
* Refactor Bitmap Storage for SkPicture using SkPipe's design.Gravatar djsollen@google.com2012-08-07
| | | | | | | | | | | | | | | | | | | | | Refactor Picture and Pipe bitmap storage into common data structure Update SkFlattenable buffers to be more modular. This CL is an effort to stage the conversion to named parameters for all SkFlattenable commands. This particular stage only does the following two things... 1. Move flattenable buffers from SkFlattenable.h into their own header. 2. Update and Add new read write methods for better clarity and convenience. BUG= Review URL: https://codereview.appspot.com/6445079 git-svn-id: http://skia.googlecode.com/svn/trunk@4994 2bbb7eff-a529-9590-31e7-b0007b416f81
* Update SkFlattenable buffers to be more modular.Gravatar djsollen@google.com2012-08-07
| | | | | | | | | | | | | | | | | This CL is an effort to stage the conversion to named parameters for all SkFlattenable commands. This particular stage only does the following two things... 1. Move flattenable buffers from SkFlattenable.h into their own header. 2. Update and Add new read write methods for better clarity and convenience. BUG= Review URL: https://codereview.appspot.com/6448095 git-svn-id: http://skia.googlecode.com/svn/trunk@4980 2bbb7eff-a529-9590-31e7-b0007b416f81
* detect null pixles in setPixels() and just clear out any existing pixelref.Gravatar reed@google.com2012-07-30
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@4827 2bbb7eff-a529-9590-31e7-b0007b416f81
* Reapply "Remove Bitmaps Raw Pixel Support."Gravatar djsollen@google.com2012-07-27
| | | | | | | | | This CL reapplies r4722. Now that we have addressed the issues in Chrome tests that were causing asserts to be fired. Review URL: https://codereview.appspot.com/6452050 git-svn-id: http://skia.googlecode.com/svn/trunk@4804 2bbb7eff-a529-9590-31e7-b0007b416f81
* Revert "Remove Bitmaps Raw Pixel Support."Gravatar djsollen@google.com2012-07-26
| | | | | | | | | BUG= TEST= Review URL: https://codereview.appspot.com/6449049 git-svn-id: http://skia.googlecode.com/svn/trunk@4780 2bbb7eff-a529-9590-31e7-b0007b416f81
* Prevent MipMaps from crashing.Gravatar bungeman@google.com2012-07-25
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@4753 2bbb7eff-a529-9590-31e7-b0007b416f81
* Remove Bitmaps Raw Pixel Support.Gravatar djsollen@google.com2012-07-23
| | | | | | | | bitmap.setPixels(...) now creates a mutable pixelRef instead of just setting fPixels. Review URL: https://codereview.appspot.com/6419044 git-svn-id: http://skia.googlecode.com/svn/trunk@4722 2bbb7eff-a529-9590-31e7-b0007b416f81
* Expanded distribution of instance countingGravatar robertphillips@google.com2012-06-21
| | | | | | | | http://codereview.appspot.com/6300114/ git-svn-id: http://skia.googlecode.com/svn/trunk@4291 2bbb7eff-a529-9590-31e7-b0007b416f81
* For SkGPipe, store bitmaps in a common location.Gravatar scroggo@google.com2012-06-13
| | | | | | | | Also make a change to SkBitmap::copyTo() so that we do not crash. Review URL: https://codereview.appspot.com/6296066 git-svn-id: http://skia.googlecode.com/svn/trunk@4249 2bbb7eff-a529-9590-31e7-b0007b416f81
* Move SkColorTable into its own header and reduce includes in SkFlattenable.hGravatar djsollen@google.com2012-06-12
| | | | | | Review URL: https://codereview.appspot.com/6299072 git-svn-id: http://skia.googlecode.com/svn/trunk@4236 2bbb7eff-a529-9590-31e7-b0007b416f81
* Punctuation cleanup to satisfy idiosyncracies of OpenBSD gcc 4.2.1.Gravatar tomhudson@google.com2012-06-01
| | | | | | | | | | Original patch by landry.breuil. http://code.google.com/p/skia/issues/detail?id=626 git-svn-id: http://skia.googlecode.com/svn/trunk@4112 2bbb7eff-a529-9590-31e7-b0007b416f81
* Mutexes in pixelrefs were done very sloppily initially. The code (a) assumes allGravatar reed@google.com2012-05-17
| | | | | | | | | | | | | | | | | | | | pixelref subclasses want a mutex to guard their lock/unlock virtuals, and (b) most subclasses use the same mutex for *all* of their instances, even when there is no explicit need to guard modifying one instances with another. When we try drawing bitmaps from multiple threads, we are seeing a lot of slow- down from these mutexes. This CL has two changes to try to speed things up. 1. Add setPreLocked(), for pixelrefs who never need the onLockPixels virtual to be called. This speeds up those subclasses in multithreaded environs as it avoids the mutex lock all together (e.g. SkMallocPixelRef). 2. Add setMutex() to allow a subclass to change the mutex choice. ashmem wants this, since its unflattening constructor cannot pass down the null, it needs to cleanup afterwards. Review URL: https://codereview.appspot.com/6199075 git-svn-id: http://skia.googlecode.com/svn/trunk@3985 2bbb7eff-a529-9590-31e7-b0007b416f81
* Consolidate PixelRef flattables with the standard implGravatar djsollen@google.com2012-03-28
| | | | | | | | | | The flatten method on these functions can no longer be const as SkFlattenables declaration is not const and would result in the const methods only being called when the reference to the object was const. Review URL: https://codereview.appspot.com/5941043 git-svn-id: http://skia.googlecode.com/svn/trunk@3533 2bbb7eff-a529-9590-31e7-b0007b416f81
* Make use of the functions in the flattenable reader/writerGravatar djsollen@google.com2012-03-26
| | | | | | Review URL: https://codereview.appspot.com/5905066 git-svn-id: http://skia.googlecode.com/svn/trunk@3493 2bbb7eff-a529-9590-31e7-b0007b416f81
* add IRect variant of getBounds()Gravatar reed@google.com2012-03-16
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@3414 2bbb7eff-a529-9590-31e7-b0007b416f81
* add getBounds() helperGravatar reed@google.com2012-03-15
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@3409 2bbb7eff-a529-9590-31e7-b0007b416f81
* Revert r3036. This change breaks loading images asGravatar caryclark@google.com2012-02-17
| | | | | | | | | described in Chromium issue 114107. The Chromium break may be fixed by WebKit patch 78239, at which time this patch can be reapplied. Review URL: https://codereview.appspot.com/5675077 git-svn-id: http://skia.googlecode.com/svn/trunk@3219 2bbb7eff-a529-9590-31e7-b0007b416f81
* Modify SkBitmap::extractSubset() to respect volatilityGravatar skyostil@google.com2012-01-16
| | | | | | | | | | The resulting subset bitmap will always have the same volatility flag as the source bitmap. BUG=452 Review URL: http://codereview.appspot.com/5544052 git-svn-id: http://skia.googlecode.com/svn/trunk@3039 2bbb7eff-a529-9590-31e7-b0007b416f81
* Modify SkBitmap::extractSubset() to respect opaquenessGravatar skyostil@google.com2012-01-13
| | | | | | | | | | The resulting subset bitmap will always have the same opaqueness flag as the source bitmap. BUG=439 Review URL: http://codereview.appspot.com/5534051 git-svn-id: http://skia.googlecode.com/svn/trunk@3036 2bbb7eff-a529-9590-31e7-b0007b416f81
* Add SkDEBUGFAIL to clean up use of SkASSERT(!"text");Gravatar tomhudson@google.com2011-12-28
| | | | | | | | | | catch a couple of latent SkASSERT("text") bugs. http://codereview.appspot.com/5504090/ git-svn-id: http://skia.googlecode.com/svn/trunk@2926 2bbb7eff-a529-9590-31e7-b0007b416f81
* Exposing the isImmutable/setImmutable API of SkPixelRef in SkBitmapGravatar junov@chromium.org2011-12-15
| | | | | | | | REVIEW=http://codereview.appspot.com/5491055/ git-svn-id: http://skia.googlecode.com/svn/trunk@2883 2bbb7eff-a529-9590-31e7-b0007b416f81
* When a bitmap is texture-backed, change SkBitmap::copyTo() to do a deepGravatar senorblanco@chromium.org2011-12-02
| | | | | | | | | | | copy of the texels in VRAM rather than a readback and re-upload. This gives a 3-10X speedup on recursive canvas-to-canvas draws. N.B.: This introduces a new GM test, which will need new baselines. git-svn-id: http://skia.googlecode.com/svn/trunk@2790 2bbb7eff-a529-9590-31e7-b0007b416f81
* Recommit r2584 with gpu pass of the new ReadPixels test disabled in fixed pt ↵Gravatar bsalomon@google.com2011-11-02
| | | | | | (gpu code doesn't work in general in fixed pt). git-svn-id: http://skia.googlecode.com/svn/trunk@2586 2bbb7eff-a529-9590-31e7-b0007b416f81
* Revert r2584 (new test fails in fixed pt builds)Gravatar bsalomon@google.com2011-11-02
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@2585 2bbb7eff-a529-9590-31e7-b0007b416f81
* Changes the SkCanvas::readPixels API. Allows caller to read into prealloced ↵Gravatar bsalomon@google.com2011-11-02
| | | | | | | | | | bitmap pixels. Changes how clipping to device bounds is handled. Review URL: http://codereview.appspot.com/5307077/ git-svn-id: http://skia.googlecode.com/svn/trunk@2584 2bbb7eff-a529-9590-31e7-b0007b416f81
* remove unused copyPixelsFrom ... (copyPixelsTo is next on the chopping block)Gravatar reed@google.com2011-11-01
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@2579 2bbb7eff-a529-9590-31e7-b0007b416f81
* Change SkAutoMaskImage so that we're less likely to write leaky code.Gravatar bungeman@google.com2011-10-04
| | | | | | | http://codereview.appspot.com/5180047/ git-svn-id: http://skia.googlecode.com/svn/trunk@2409 2bbb7eff-a529-9590-31e7-b0007b416f81
* Automatic update of all copyright notices to reflect new license terms.Gravatar epoger@google.com2011-07-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I have manually examined all of these diffs and restored a few files that seem to require manual adjustment. The following files still need to be modified manually, in a separate CL: android_sample/SampleApp/AndroidManifest.xml android_sample/SampleApp/res/layout/layout.xml android_sample/SampleApp/res/menu/sample.xml android_sample/SampleApp/res/values/strings.xml android_sample/SampleApp/src/com/skia/sampleapp/SampleApp.java android_sample/SampleApp/src/com/skia/sampleapp/SampleView.java experimental/CiCarbonSampleMain.c experimental/CocoaDebugger/main.m experimental/FileReaderApp/main.m experimental/SimpleCocoaApp/main.m experimental/iOSSampleApp/Shared/SkAlertPrompt.h experimental/iOSSampleApp/Shared/SkAlertPrompt.m experimental/iOSSampleApp/SkiOSSampleApp-Base.xcconfig experimental/iOSSampleApp/SkiOSSampleApp-Debug.xcconfig experimental/iOSSampleApp/SkiOSSampleApp-Release.xcconfig gpu/src/android/GrGLDefaultInterface_android.cpp gyp/common.gypi gyp_skia include/ports/SkHarfBuzzFont.h include/views/SkOSWindow_wxwidgets.h make.bat make.py src/opts/memset.arm.S src/opts/memset16_neon.S src/opts/memset32_neon.S src/opts/opts_check_arm.cpp src/ports/SkDebug_brew.cpp src/ports/SkMemory_brew.cpp src/ports/SkOSFile_brew.cpp src/ports/SkXMLParser_empty.cpp src/utils/ios/SkImageDecoder_iOS.mm src/utils/ios/SkOSFile_iOS.mm src/utils/ios/SkStream_NSData.mm tests/FillPathTest.cpp Review URL: http://codereview.appspot.com/4816058 git-svn-id: http://skia.googlecode.com/svn/trunk@1982 2bbb7eff-a529-9590-31e7-b0007b416f81
* Allow texture-backed bitmaps to perform a read-back when lockPixels is called.Gravatar reed@google.com2011-07-07
| | | | | | | | | | This means we have to be even more cautious about when we call lock, and we should always check getTexture() first if we can handle a texture directly, rather than forcing the read-back to get the bits. git-svn-id: http://skia.googlecode.com/svn/trunk@1815 2bbb7eff-a529-9590-31e7-b0007b416f81
* Adding the notion of a volatile bitmap to SkBitmap. Gravatar junov@google.com2011-06-30
| | | | | | | | | | | | | | | | | Volatility is a hint that indicates that the contents of a bitmap are ephemeral. SkGpuDevice will not preserve volatile bitmaps in its texture cache, and will use textures from a pool of keyless (recyclable) textures to avoid the performance hit of texture allocation and release. A subsequent change is required in webkit in order to take advantage of this optimization. putImageData, and other methods that create temporary bitmaps will have to mark their bitmaps as volatile. before rendering them through skia. git-svn-id: http://skia.googlecode.com/svn/trunk@1769 2bbb7eff-a529-9590-31e7-b0007b416f81
* Increase compatibility with clang, mostly around SK_RESTRICT.Gravatar tomhudson@google.com2011-06-15
| | | | | | | | Attempting to fix up our use of __restrict__ so Chrome can enable it. git-svn-id: http://skia.googlecode.com/svn/trunk@1597 2bbb7eff-a529-9590-31e7-b0007b416f81
* update doxGravatar reed@google.com2011-04-29
| | | | | | | | code style git-svn-id: http://skia.googlecode.com/svn/trunk@1215 2bbb7eff-a529-9590-31e7-b0007b416f81
* Add genID for SkBitmaps with raw pixelsGravatar bsalomon@google.com2011-04-14
| | | | | | | | Review URL: http://codereview.appspot.com/4413047/ git-svn-id: http://skia.googlecode.com/svn/trunk@1125 2bbb7eff-a529-9590-31e7-b0007b416f81
* Adds read pixels to GrTexture and GrRenderTargetGravatar bsalomon@google.com2011-04-05
| | | | | | | | | Adds SkGrRenderTargetPixelRef for SkBitmaps that are backed by RTs that aren't textures. Adds onReadPixels implementations for SkGr pixel ref types git-svn-id: http://skia.googlecode.com/svn/trunk@1056 2bbb7eff-a529-9590-31e7-b0007b416f81
* add pixelref->readPixels()Gravatar reed@google.com2011-04-01
| | | | | | | | unimplemented (for now) on the gpu side git-svn-id: http://skia.googlecode.com/svn/trunk@1037 2bbb7eff-a529-9590-31e7-b0007b416f81