diff options
author | jbauman@chromium.org <jbauman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-14 18:50:28 +0000 |
---|---|---|
committer | jbauman@chromium.org <jbauman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-14 18:50:28 +0000 |
commit | 7407ad6a55334063610f5cca5bfb225085c2586c (patch) | |
tree | cbe450026a2b240b9bb30ebd081971ae1cae8c1b /cc | |
parent | b999632dd3e2070d872cd0546fab7b6ea8e319a8 (diff) | |
download | chromium_src-7407ad6a55334063610f5cca5bfb225085c2586c.zip chromium_src-7407ad6a55334063610f5cca5bfb225085c2586c.tar.gz chromium_src-7407ad6a55334063610f5cca5bfb225085c2586c.tar.bz2 |
Revert 256955 "Add shared bitmap managers for browser and render..."
Seems to be causing renderer crashes and possibly out-of-memory issues.
> Add shared bitmap managers for browser and renderer processes.
>
> The shared bitmap managers will allow software tiles to be allocated in shared memory, so delegated rendering could be used with them.
>
> BUG=327220
> R=danakj@chromium.org, jschuh@chromium.org, piman@chromium.org
>
> Review URL: https://codereview.chromium.org/148243013
TBR=jbauman@chromium.org
BUG=352689,352616,352618
Review URL: https://codereview.chromium.org/197703004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@257161 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc')
-rw-r--r-- | cc/output/delegating_renderer.cc | 4 | ||||
-rw-r--r-- | cc/resources/resource_provider.cc | 3 | ||||
-rw-r--r-- | cc/resources/shared_bitmap.cc | 25 | ||||
-rw-r--r-- | cc/resources/shared_bitmap.h | 6 |
4 files changed, 3 insertions, 35 deletions
diff --git a/cc/output/delegating_renderer.cc b/cc/output/delegating_renderer.cc index b189386..66cd53c 100644 --- a/cc/output/delegating_renderer.cc +++ b/cc/output/delegating_renderer.cc @@ -162,8 +162,8 @@ void DelegatingRenderer::SetVisible(bool visible) { // We loop visibility to the GPU process, since that's what manages memory. // That will allow it to feed us with memory allocations that we can act // upon. - if (context_provider) - context_provider->ContextSupport()->SetSurfaceVisible(visible); + DCHECK(context_provider); + context_provider->ContextSupport()->SetSurfaceVisible(visible); } void DelegatingRenderer::SendManagedMemoryStats(size_t bytes_visible, diff --git a/cc/resources/resource_provider.cc b/cc/resources/resource_provider.cc index 2fee3d2..ed1d0da 100644 --- a/cc/resources/resource_provider.cc +++ b/cc/resources/resource_provider.cc @@ -1949,8 +1949,7 @@ void ResourceProvider::BeginSetPixels(ResourceId id) { DCHECK(resource->pixel_buffer); DCHECK_EQ(RGBA_8888, resource->format); - memcpy( - resource->pixels, resource->pixel_buffer, 4 * resource->size.GetArea()); + std::swap(resource->pixels, resource->pixel_buffer); delete[] resource->pixel_buffer; resource->pixel_buffer = NULL; } diff --git a/cc/resources/shared_bitmap.cc b/cc/resources/shared_bitmap.cc index 3b94d45..3a6fc35 100644 --- a/cc/resources/shared_bitmap.cc +++ b/cc/resources/shared_bitmap.cc @@ -4,9 +4,6 @@ #include "cc/resources/shared_bitmap.h" -#include "base/numerics/safe_math.h" -#include "base/rand_util.h" - namespace cc { SharedBitmap::SharedBitmap( @@ -17,26 +14,4 @@ SharedBitmap::SharedBitmap( SharedBitmap::~SharedBitmap() { free_callback_.Run(this); } -// static -bool SharedBitmap::GetSizeInBytes(const gfx::Size& size, - size_t* size_in_bytes) { - if (size.width() <= 0 || size.height() <= 0) - return false; - base::CheckedNumeric<int> s = size.width(); - s *= size.height(); - s *= 4; - if (!s.IsValid()) - return false; - *size_in_bytes = s.ValueOrDie(); - return true; -} - -// static -SharedBitmapId SharedBitmap::GenerateId() { - SharedBitmapId id; - // Needs cryptographically-secure random numbers. - base::RandBytes(id.name, sizeof(id.name)); - return id; -} - } // namespace cc diff --git a/cc/resources/shared_bitmap.h b/cc/resources/shared_bitmap.h index d62ffcc..9575068 100644 --- a/cc/resources/shared_bitmap.h +++ b/cc/resources/shared_bitmap.h @@ -10,7 +10,6 @@ #include "base/memory/shared_memory.h" #include "cc/base/cc_export.h" #include "gpu/command_buffer/common/mailbox.h" -#include "ui/gfx/size.h" namespace base { class SharedMemory; } @@ -39,11 +38,6 @@ class CC_EXPORT SharedBitmap { SharedBitmapId id() { return id_; } - // Returns true if the size is valid and false otherwise. - static bool GetSizeInBytes(const gfx::Size& size, size_t* size_in_bytes); - - static SharedBitmapId GenerateId(); - private: base::SharedMemory* memory_; SharedBitmapId id_; |