Remove getData from BufferImpl.
We only ever call this method inside the D3D Renderer, so we can
downcast to BufferD3D and call getData on the D3D-specific type.
Leave a FIXME for handling index range validation, which will
need a CPU-side data cache.
Change-Id: Iaf71bc8055869a8561777b6b36f67e376a1d0b81
Reviewed-on: https://chromium-review.googlesource.com/224654
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
diff --git a/src/libGLESv2/renderer/d3d/TextureD3D.cpp b/src/libGLESv2/renderer/d3d/TextureD3D.cpp
index 51593b3..1028b1b 100644
--- a/src/libGLESv2/renderer/d3d/TextureD3D.cpp
+++ b/src/libGLESv2/renderer/d3d/TextureD3D.cpp
@@ -9,7 +9,7 @@
#include "libGLESv2/renderer/d3d/TextureD3D.h"
#include "libGLESv2/renderer/d3d/TextureStorage.h"
#include "libGLESv2/renderer/d3d/ImageD3D.h"
-#include "libGLESv2/Buffer.h"
+#include "libGLESv2/renderer/d3d/BufferD3D.h"
#include "libGLESv2/Framebuffer.h"
#include "libGLESv2/Texture.h"
#include "libGLESv2/main.h"
@@ -39,8 +39,10 @@
// TODO: this is the only place outside of renderer that asks for a buffers raw data.
// This functionality should be moved into renderer and the getData method of BufferImpl removed.
+ BufferD3D *bufferD3D = BufferD3D::makeBufferD3D(pixelBuffer->getImplementation());
+ ASSERT(bufferD3D);
const uint8_t *bufferData = NULL;
- gl::Error error = pixelBuffer->getImplementation()->getData(&bufferData);
+ gl::Error error = bufferD3D->getData(&bufferData);
if (error.isError())
{
return error;