Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(172)

Issue 1925583005: Revert of Enable flattening of SkRecordedDrawable (Closed)

Created:
4 years, 7 months ago by reed1
Modified:
4 years, 7 months ago
Reviewers:
msarett, mtklein, djsollen
CC:
reviews_skia.org
Base URL:
https://skia.googlesource.com/skia.git@master
Target Ref:
refs/heads/master
Project:
skia
Visibility:
Public.

Description

Revert of Enable flattening of SkRecordedDrawable (patchset #8 id:140001 of https://codereview.chromium.org/1913843002/ ) Reason for revert: nanobench failing (skps ?) Original issue's description: > Enable flattening of SkRecordedDrawable > > BUG=skia: > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1913843002 > > Committed: https://skia.googlesource.com/skia/+/d636950e8ecba89c0021ce4e76037c67aa6ee2cd TBR=mtklein@google.com,djsollen@google.com,msarett@google.com # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia:

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+61 lines, -285 lines) Patch
M gyp/core.gypi View 1 chunk +0 lines, -1 line 0 comments Download
M src/core/SkGlobalInitialization_core.cpp View 2 chunks +1 line, -5 lines 0 comments Download
M src/core/SkPictureData.h View 4 chunks +0 lines, -10 lines 0 comments Download
M src/core/SkPictureData.cpp View 6 chunks +0 lines, -37 lines 0 comments Download
M src/core/SkPictureFlat.h View 1 chunk +0 lines, -2 lines 0 comments Download
M src/core/SkPicturePlayback.cpp View 1 chunk +0 lines, -9 lines 0 comments Download
M src/core/SkPictureRecord.h View 4 chunks +0 lines, -7 lines 0 comments Download
M src/core/SkPictureRecord.cpp View 3 chunks +0 lines, -29 lines 0 comments Download
M src/core/SkPictureRecorder.cpp View 2 chunks +60 lines, -1 line 0 comments Download
D src/core/SkRecordedDrawable.h View 1 chunk +0 lines, -43 lines 0 comments Download
D src/core/SkRecordedDrawable.cpp View 1 chunk +0 lines, -102 lines 0 comments Download
M tests/FlattenDrawableTest.cpp View 1 chunk +0 lines, -39 lines 0 comments Download

Messages

Total messages: 5 (2 generated)
reed1
Created Revert of Enable flattening of SkRecordedDrawable
4 years, 7 months ago (2016-04-27 16:29:43 UTC) #1
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1925583005/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1925583005/1
4 years, 7 months ago (2016-04-27 16:29:50 UTC) #2
commit-bot: I haz the power
4 years, 7 months ago (2016-04-27 16:30:00 UTC) #4
Failed to apply patch for src/core/SkRecordedDrawable.cpp:
While running git rm src/core/SkRecordedDrawable.cpp;
  fatal: pathspec 'src/core/SkRecordedDrawable.cpp' did not match any files

Patch:  D    src/core/SkRecordedDrawable.cpp
Index: src/core/SkRecordedDrawable.cpp
diff --git a/src/core/SkRecordedDrawable.cpp b/src/core/SkRecordedDrawable.cpp
deleted file mode 100644
index
9b5874f9272865047d0b58a770e4f2b0ddeca70b..0000000000000000000000000000000000000000
--- a/src/core/SkRecordedDrawable.cpp
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Copyright 2016 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#include "SkLayerInfo.h"
-#include "SkMatrix.h"
-#include "SkPictureData.h"
-#include "SkPicturePlayback.h"
-#include "SkPictureRecord.h"
-#include "SkPictureRecorder.h"
-#include "SkPictureUtils.h"
-#include "SkRecordedDrawable.h"
-#include "SkRecordDraw.h"
-
-void SkRecordedDrawable::onDraw(SkCanvas* canvas) {
-    SkDrawable* const* drawables = nullptr;
-    int drawableCount = 0;
-    if (fDrawableList) {
-        drawables = fDrawableList->begin();
-        drawableCount = fDrawableList->count();
-    }
-    SkRecordDraw(*fRecord, canvas, nullptr, drawables, drawableCount, fBBH,
nullptr/*callback*/);
-}
-
-SkPicture* SkRecordedDrawable::onNewPictureSnapshot() {
-    SkBigPicture::SnapshotArray* pictList = nullptr;
-    if (fDrawableList) {
-        // TODO: should we plumb-down the BBHFactory and recordFlags from our
host
-        //       PictureRecorder?
-        pictList = fDrawableList->newDrawableSnapshot();
-    }
-
-    SkAutoTUnref<SkLayerInfo> saveLayerData;
-    if (fBBH && fDoSaveLayerInfo) {
-        // TODO: can we avoid work by not allocating / filling these bounds?
-        SkAutoTMalloc<SkRect> scratchBounds(fRecord->count());
-        saveLayerData.reset(new SkLayerInfo);
-
-        SkRecordComputeLayers(fBounds, *fRecord, scratchBounds, pictList,
saveLayerData);
-    }
-
-    size_t subPictureBytes = 0;
-    for (int i = 0; pictList && i < pictList->count(); i++) {
-        subPictureBytes +=
SkPictureUtils::ApproximateBytesUsed(pictList->begin()[i]);
-    }
-    // SkBigPicture will take ownership of a ref on both fRecord and fBBH.
-    // We're not willing to give up our ownership, so we must ref them for
SkPicture.
-    return new SkBigPicture(fBounds, SkRef(fRecord.get()), pictList,
SkSafeRef(fBBH.get()),
-                            saveLayerData.release(), subPictureBytes);
-}
-
-void SkRecordedDrawable::flatten(SkWriteBuffer& buffer) const {
-    // Write the bounds.
-    buffer.writeRect(fBounds);
-
-    // Create an SkPictureRecord to record the draw commands.
-    SkPictInfo info;
-    SkPictureRecord pictureRecord(SkISize::Make(fBounds.width(),
fBounds.height()), 0);
-
-    // If the query contains the whole picture, don't bother with the bounding
box hierarchy.
-    SkRect clipBounds;
-    pictureRecord.getClipBounds(&clipBounds);
-    SkBBoxHierarchy* bbh;
-    if (clipBounds.contains(fBounds)) {
-        bbh = nullptr;
-    } else {
-        bbh = fBBH.get();
-    }
-
-    // Record the draw commands.
-    pictureRecord.beginRecording();
-    SkRecordDraw(*fRecord, &pictureRecord, nullptr, fDrawableList->begin(),
fDrawableList->count(),
-                bbh, nullptr);
-    pictureRecord.endRecording();
-
-    // Flatten the recorded commands and drawables.
-    SkPictureData pictureData(pictureRecord, info, false);
-    pictureData.flatten(buffer);
-}
-
-sk_sp<SkFlattenable> SkRecordedDrawable::CreateProc(SkReadBuffer& buffer) {
-    // Read the bounds.
-    SkRect bounds;
-    buffer.readRect(&bounds);
-
-    // Unflatten into a SkPictureData.
-    SkPictInfo info;
-    info.fCullRect = bounds;
-    SkAutoTDelete<SkPictureData>
pictureData(SkPictureData::CreateFromBuffer(buffer, info));
-    if (!pictureData) {
-        return nullptr;
-    }
-
-    // Create a drawable.
-    SkPicturePlayback playback(pictureData);
-    SkPictureRecorder recorder;
-    playback.draw(recorder.beginRecording(bounds), nullptr, &buffer);
-    return recorder.finishRecordingAsDrawable();
-}

Powered by Google App Engine
This is Rietveld 408576698