summaryrefslogtreecommitdiffstats
path: root/ui/gfx/surface
diff options
context:
space:
mode:
authorgroby@chromium.org <groby@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-19 02:13:33 +0000
committergroby@chromium.org <groby@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-19 02:13:33 +0000
commita4888371ccdbafb22e8ce8345f77dee166a6bb4f (patch)
tree82f0a844848d949809bb1f9a4bd3f6107aa7b7e7 /ui/gfx/surface
parentdc61f78b8191e72c4a3267a79066bce62c2dc8b3 (diff)
downloadchromium_src-a4888371ccdbafb22e8ce8345f77dee166a6bb4f.zip
chromium_src-a4888371ccdbafb22e8ce8345f77dee166a6bb4f.tar.gz
chromium_src-a4888371ccdbafb22e8ce8345f77dee166a6bb4f.tar.bz2
base::Bind fixes
BUG=none TEST=none Review URL: http://codereview.chromium.org/8601002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110818 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/gfx/surface')
-rw-r--r--ui/gfx/surface/accelerated_surface_mac.cc20
-rw-r--r--ui/gfx/surface/accelerated_surface_mac.h11
2 files changed, 15 insertions, 16 deletions
diff --git a/ui/gfx/surface/accelerated_surface_mac.cc b/ui/gfx/surface/accelerated_surface_mac.cc
index 759ae81..b0fb156 100644
--- a/ui/gfx/surface/accelerated_surface_mac.cc
+++ b/ui/gfx/surface/accelerated_surface_mac.cc
@@ -71,8 +71,8 @@ void AcceleratedSurface::Destroy() {
// these objects.
// Release the old TransportDIB in the browser.
- if (dib_free_callback_.get() && transport_dib_.get()) {
- dib_free_callback_->Run(transport_dib_->id());
+ if (!dib_free_callback_.is_null() && transport_dib_.get()) {
+ dib_free_callback_.Run(transport_dib_->id());
}
transport_dib_.reset();
@@ -331,8 +331,8 @@ TransportDIB::Handle AcceleratedSurface::SetTransportDIBSize(
real_surface_size_ = clamped_size;
// Release the old TransportDIB in the browser.
- if (dib_free_callback_.get() && transport_dib_.get()) {
- dib_free_callback_->Run(transport_dib_->id());
+ if (!dib_free_callback_.is_null() && transport_dib_.get()) {
+ dib_free_callback_.Run(transport_dib_->id());
}
transport_dib_.reset();
@@ -340,8 +340,8 @@ TransportDIB::Handle AcceleratedSurface::SetTransportDIBSize(
size_t dib_size =
clamped_size.width() * 4 * clamped_size.height(); // 4 bytes per pixel.
TransportDIB::Handle dib_handle;
- if (dib_alloc_callback_.get()) {
- dib_alloc_callback_->Run(dib_size, &dib_handle);
+ if (!dib_alloc_callback_.is_null()) {
+ dib_alloc_callback_.Run(dib_size, &dib_handle);
}
if (!TransportDIB::is_valid_handle(dib_handle)) {
// If the allocator fails, it means the DIB was not created in the browser,
@@ -376,8 +376,8 @@ TransportDIB::Handle AcceleratedSurface::SetTransportDIBSize(
}
void AcceleratedSurface::SetTransportDIBAllocAndFree(
- Callback2<size_t, TransportDIB::Handle*>::Type* allocator,
- Callback1<TransportDIB::Id>::Type* deallocator) {
- dib_alloc_callback_.reset(allocator);
- dib_free_callback_.reset(deallocator);
+ const base::Callback<void(size_t, TransportDIB::Handle*)>& allocator,
+ const base::Callback<void(TransportDIB::Id)>& deallocator) {
+ dib_alloc_callback_ = allocator;
+ dib_free_callback_ = deallocator;
}
diff --git a/ui/gfx/surface/accelerated_surface_mac.h b/ui/gfx/surface/accelerated_surface_mac.h
index 0e29ae5..83c95d6 100644
--- a/ui/gfx/surface/accelerated_surface_mac.h
+++ b/ui/gfx/surface/accelerated_surface_mac.h
@@ -8,7 +8,7 @@
#include <CoreFoundation/CoreFoundation.h>
-#include "base/callback_old.h"
+#include "base/bind.h"
#include "base/mac/scoped_cftyperef.h"
#include "base/memory/scoped_ptr.h"
#include "ui/gfx/gl/gl_context.h"
@@ -112,8 +112,8 @@ class SURFACE_EXPORT AcceleratedSurface {
// Sets the methods to use for allocating and freeing memory for the
// transport DIB.
void SetTransportDIBAllocAndFree(
- Callback2<size_t, TransportDIB::Handle*>::Type* allocator,
- Callback1<TransportDIB::Id>::Type* deallocator);
+ const base::Callback<void(size_t, TransportDIB::Handle*)>& allocator,
+ const base::Callback<void(TransportDIB::Id)>& deallocator);
// Get the accelerated surface size.
gfx::Size GetSize() const { return surface_size_; }
@@ -175,9 +175,8 @@ class SURFACE_EXPORT AcceleratedSurface {
GLuint fbo_;
GLuint depth_stencil_renderbuffer_;
// Allocate a TransportDIB in the renderer.
- scoped_ptr<Callback2<size_t, TransportDIB::Handle*>::Type>
- dib_alloc_callback_;
- scoped_ptr<Callback1<TransportDIB::Id>::Type> dib_free_callback_;
+ base::Callback<void(size_t, TransportDIB::Handle*)> dib_alloc_callback_;
+ base::Callback<void(TransportDIB::Id)> dib_free_callback_;
};
#endif // UI_GFX_SURFACE_ACCELERATED_SURFACE_MAC_H_