diff options
author | 2014-08-19 14:20:58 -0700 | |
---|---|---|
committer | 2014-08-19 14:20:58 -0700 | |
commit | 1d89ddc4a3aad153501cfdc93bc1d61eb49157f4 (patch) | |
tree | 50a7441dbe82df4fe9f47c4423595f8ff8e259ff /src/gpu/GrResourceCache2.cpp | |
parent | a34633f358ddde34577d653fea3bd41e66a7dde2 (diff) |
Revert of Add GrResourceCache2. (patchset #4 of https://codereview.chromium.org/481443002/)
Reason for revert:
Likely caused a leak detected in Chromium after last Skia roll.
Original issue's description:
> Add GrResourceCache2.
>
> Currently it just replaces GrGpu as the owner of the linked list of resources.
>
> Committed: https://skia.googlesource.com/skia/+/94ce9ac8624dbb45656b8f5c992fad9c9ff3ee5f
R=mtklein@google.com, robertphillips@google.com
TBR=mtklein@google.com, robertphillips@google.com
NOTREECHECKS=true
NOTRY=true
Author: bsalomon@google.com
Review URL: https://codereview.chromium.org/477323006
Diffstat (limited to 'src/gpu/GrResourceCache2.cpp')
-rw-r--r-- | src/gpu/GrResourceCache2.cpp | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/src/gpu/GrResourceCache2.cpp b/src/gpu/GrResourceCache2.cpp deleted file mode 100644 index 0b6944ee85..0000000000 --- a/src/gpu/GrResourceCache2.cpp +++ /dev/null @@ -1,47 +0,0 @@ - -/* - * Copyright 2014 Google Inc. - * - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - - -#include "GrResourceCache2.h" -#include "GrGpuResource.h" - -GrResourceCache2::~GrResourceCache2() { - this->releaseAll(); -} - -void GrResourceCache2::insertResource(GrGpuResource* resource) { - SkASSERT(NULL != resource); - SkASSERT(!resource->wasDestroyed()); - fResources.addToHead(resource); - ++fCount; -} - -void GrResourceCache2::removeResource(GrGpuResource* resource) { - fResources.remove(resource); - --fCount; -} - -void GrResourceCache2::abandonAll() { - while (GrGpuResource* head = fResources.head()) { - SkASSERT(!head->wasDestroyed()); - head->abandon(); - // abandon should have already removed this from the list. - SkASSERT(head != fResources.head()); - } - SkASSERT(!fCount); -} - -void GrResourceCache2::releaseAll() { - while (GrGpuResource* head = fResources.head()) { - SkASSERT(!head->wasDestroyed()); - head->release(); - // release should have already removed this from the list. - SkASSERT(head != fResources.head()); - } - SkASSERT(!fCount); -} |