This source file includes following definitions.
- enabled_bindings_
- GetDrawingCanvas
- ReleaseTransportDIB
- AddBindings
- GetEnabledBindings
- CreateTransportDIB
- FreeTransportDIB
#include "content/test/mock_render_process.h"
#include "ui/gfx/rect.h"
#include "ui/surface/transport_dib.h"
namespace content {
MockRenderProcess::MockRenderProcess()
: transport_dib_next_sequence_number_(0),
enabled_bindings_(0) {
}
MockRenderProcess::~MockRenderProcess() {
}
skia::PlatformCanvas* MockRenderProcess::GetDrawingCanvas(
TransportDIB** memory,
const gfx::Rect& rect) {
size_t stride = skia::PlatformCanvasStrideForWidth(rect.width());
size_t size = stride * rect.height();
*memory = TransportDIB::Create(size, transport_dib_next_sequence_number_++);
if (!*memory)
return NULL;
return (*memory)->GetPlatformCanvas(rect.width(), rect.height());
}
void MockRenderProcess::ReleaseTransportDIB(TransportDIB* memory) {
delete memory;
}
void MockRenderProcess::AddBindings(int bindings) {
enabled_bindings_ |= bindings;
}
int MockRenderProcess::GetEnabledBindings() const {
return enabled_bindings_;
}
TransportDIB* MockRenderProcess::CreateTransportDIB(size_t size) {
return TransportDIB::Create(size, transport_dib_next_sequence_number_++);
}
void MockRenderProcess::FreeTransportDIB(TransportDIB* dib) {
delete dib;
}
}