)]}'
{
  "commit": "4afdd1caa4ff5f0890c3f4d73c6d475f9e06cefd",
  "tree": "5273aecef15d3644e794416ababff8cbaacddd94",
  "parents": [
    "1936031cbe804fc53eb7529b3fd60f3457cb1780"
  ],
  "author": {
    "name": "Leon Scroggins III",
    "email": "scroggo@google.com",
    "time": "Mon May 14 14:59:30 2018 -0400"
  },
  "committer": {
    "name": "Leon Scroggins III",
    "email": "scroggo@google.com",
    "time": "Wed May 16 18:51:07 2018 -0400"
  },
  "message": "AnimatedImageDrawable: Eliminate unnecessary calls to redraw\n\nBug: 78866720\nTest: Manual + systrace; existing CTS\n\nPreviously, we set hasAnimations to true when the AnimatedImageDrawable,\nso that we would get a call to redraw. But if the image does not need to\nshow its next frame yet, the redraw was unnecessary.\n\nInstead, add a new field to TreeInfo::Out, representing the delay time\nuntil the image will need to be redrawn - i.e. when the duration of the\ncurrent frame has passed. Each call to prepareTree will post at most one\nmessage to redraw, in time for the earliest animated image to be\nredrawn. Post the message for one rendered frame ahead of time, so that\nwhen it is time to show the next frame, the image has already gotten the\nmessage to update.\n\nOn a screen with a single animated image, this drops the number of calls\nto dispatchFrameCallbacks to as infrequent as possible. It is called\nonly when we need to draw a new frame of the image. On a screen with\nmultiple animated images, the calls may be redundant, but they will not\nbe more frequent than they would be without this change.\n\nSwitch to nsecs_t and systemTime internally, matching the rest of HWUI.\n\nRemove mDidDraw and related. Its purpose was to prevent advancing the\nanimation while the image is not being drawn. But it isn\u0027t really\nnecessary. If it\u0027s not drawn, onDraw is not called, which is where we\ntrigger decoding. And onDraw already has a defense against getting too\nfar ahead - if its timer indicates that it should skip a frame or show\nit very briefly, it will back up its timer. More importantly, mDidDraw\ncaused a bug, when combined with less frequent redraws. If the display\nlist containing the drawable doesn\u0027t need to be redrawn for other\nreasons, the drawable\u0027s timer never advanced, so its animation stopped.\n\nFix software drawing. Compute the milliseconds in the future to draw the\nnext frame, and add that to SystemClock.uptimeMillis() to compute the\ntime to pass to scheduleSelf.\n\nChange-Id: I13aab49922fa300f73b327be25561d7120c09ec4\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "7166c757e602c7ed1a4d612c9b1e115462b0954f",
      "old_mode": 33188,
      "old_path": "core/jni/android/graphics/AnimatedImageDrawable.cpp",
      "new_id": "8dd5f5f0e561bf5cbc249ecf763ae95fca11a58e",
      "new_mode": 33188,
      "new_path": "core/jni/android/graphics/AnimatedImageDrawable.cpp"
    },
    {
      "type": "modify",
      "old_id": "898939edabf0e9b6b37cbff561fb7bf072d3b830",
      "old_mode": 33188,
      "old_path": "graphics/java/android/graphics/drawable/AnimatedImageDrawable.java",
      "new_id": "4f467d9aabae9023db728ec1993e47c6174010ef",
      "new_mode": 33188,
      "new_path": "graphics/java/android/graphics/drawable/AnimatedImageDrawable.java"
    },
    {
      "type": "modify",
      "old_id": "d7012697a91ed236a9e08bf5e3d8ae5657485e89",
      "old_mode": 33188,
      "old_path": "libs/hwui/TreeInfo.h",
      "new_id": "b37f2cfe7fee4141697b3b5b3d5aa64d1fee7c08",
      "new_mode": 33188,
      "new_path": "libs/hwui/TreeInfo.h"
    },
    {
      "type": "modify",
      "old_id": "c529f8773bbd2ec71c78769c809efe61602cbce1",
      "old_mode": 33188,
      "old_path": "libs/hwui/hwui/AnimatedImageDrawable.cpp",
      "new_id": "007961a6bedbf66cb1e128fd32c3db4545dea9b9",
      "new_mode": 33188,
      "new_path": "libs/hwui/hwui/AnimatedImageDrawable.cpp"
    },
    {
      "type": "modify",
      "old_id": "a92b62db14f0a379d2d6abc41e743c3a474634c8",
      "old_mode": 33188,
      "old_path": "libs/hwui/hwui/AnimatedImageDrawable.h",
      "new_id": "115c45ae4bcb114adf69cf20bdcf27e19f3aeb8a",
      "new_mode": 33188,
      "new_path": "libs/hwui/hwui/AnimatedImageDrawable.h"
    },
    {
      "type": "modify",
      "old_id": "aa14699ae4c201e7b11d5351a9c56ea6e4769b35",
      "old_mode": 33188,
      "old_path": "libs/hwui/pipeline/skia/SkiaDisplayList.cpp",
      "new_id": "82179a37f5bee3305ed14a60955db3526a13d4f6",
      "new_mode": 33188,
      "new_path": "libs/hwui/pipeline/skia/SkiaDisplayList.cpp"
    },
    {
      "type": "modify",
      "old_id": "f4d8051466f0fc1241223525591e892e23b760e1",
      "old_mode": 33188,
      "old_path": "libs/hwui/renderthread/CanvasContext.cpp",
      "new_id": "2ddf55be7574630d88cd2438242b047e511aa556",
      "new_mode": 33188,
      "new_path": "libs/hwui/renderthread/CanvasContext.cpp"
    },
    {
      "type": "modify",
      "old_id": "c2cc72a6917f122b2c8b24c563acf8ab060e3b09",
      "old_mode": 33188,
      "old_path": "libs/hwui/renderthread/CanvasContext.h",
      "new_id": "e52b6447a611dd47193180a449c82e1b81c17a1b",
      "new_mode": 33188,
      "new_path": "libs/hwui/renderthread/CanvasContext.h"
    }
  ]
}
