skia2/include
yunchao.he 8e45c3777d Picture Recording: fix the performance bottleneck in SkDeferredCanvas::isFullFrame
blink skips all pending commands during picture recording if it is drawing an opaque full-frame
geometry or image. This may improve performance for some edge cases. To recognize an opaque
full-frame drawing should be cheap enough. Otherwise, the overhead will offset the improvement.
Unfortunately, data from perf for content_shell on Nexus7 shows that SkDeferredCanvas::isFullFrame
is far from cheap. Table below shows that how much isFullFrame() costs in the whole render process.

benchmark                              percentage
my local benchmark(draw 1000 sprites)   4.1%
speedReading                            2.8%
FishIETank(1000 fishes)                 1.5%
GUIMark3 Bitmap                         2.0%

By contrast, real recording (SkGPipeCanvas::drawBitmapRectToRect) and real rasterization
(GrDrawTarget::drawRect) cost ~4% and ~6% in the whole render process respectively. Apparently,
SkDeferredCanvas::isFullFrame() is nontrivial.

getDeviceSize() is the main contributor to this hotspot. The change simply save the canvasSize and
reuse it among drawings if it is not a fresh frame. This change cut off ~65% (or improved ~2 times)
of isFullFrame().

telemetry smoothness canvas_tough_test didn't show obvious improvement or regression.

BUG=411166
R=junov@chromium.org, tomhudson@google.com, reed@google.com

Author: yunchao.he@intel.com

Review URL: https://codereview.chromium.org/545813002
2014-09-14 18:59:04 -07:00
..
animator Sanitizing source files in Skia_Periodic_House_Keeping 2013-01-26 07:06:02 +00:00
config Add SkBarriers to ports. 2014-05-29 18:24:54 +00:00
core Add support for the Rec601 YUV color space to GrYUVtoRGBEffect. 2014-09-12 17:45:58 -07:00
device/xps Add testing flag for XPS for deterministic ids. 2014-08-22 15:07:06 -04:00
effects Reimplement deserialization of SkImageFilter's uniqueID. 2014-08-26 12:27:12 -07:00
gpu disable conservative rasterclip on gpu, until we understand perspective 2014-09-10 07:23:32 -07:00
images Remove SkImageRef and related functionality. 2014-06-04 14:38:48 -04:00
pathops add pathops tight bounds; conform path ops' gyp to unit tests 2014-06-24 07:55:12 -07:00
pdf change gpudevice and pdfdevice to inherit from basedevice 2014-06-27 11:34:19 -07:00
pipe "NULL !=" = NULL 2014-09-05 13:34:00 -07:00
ports Delete the old font management implementation based on SkFontConfigInterface, now that SkFontMgr_Android is live. 2014-08-13 10:41:25 -07:00
record add SK_API to include/record 2014-04-28 21:04:32 +00:00
svg Sanitizing source files in Skia_Periodic_House_Keeping 2013-01-26 07:06:02 +00:00
utils Picture Recording: fix the performance bottleneck in SkDeferredCanvas::isFullFrame 2014-09-14 18:59:04 -07:00
views "NULL !=" = NULL 2014-09-05 13:34:00 -07:00
xml Sanitizing source files in Skia_Periodic_House_Keeping 2013-01-26 07:06:02 +00:00