Use angle::Result in allocation and math check macros.
Replace these with ANGLE_CHECK_*_ALLOC and ANGLE_CHECK_*_MATH depending
on the specific error type.
Bug: angleproject:2491
Change-Id: Ic4395101fe701c563ae2b92aa2c55c93b934a7de
Reviewed-on: https://chromium-review.googlesource.com/c/1262737
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Frank Henigman <fjhenigman@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
diff --git a/src/libANGLE/renderer/d3d/FramebufferD3D.cpp b/src/libANGLE/renderer/d3d/FramebufferD3D.cpp
index 8c5e92e..7df422c 100644
--- a/src/libANGLE/renderer/d3d/FramebufferD3D.cpp
+++ b/src/libANGLE/renderer/d3d/FramebufferD3D.cpp
@@ -15,6 +15,7 @@
#include "libANGLE/Surface.h"
#include "libANGLE/formatutils.h"
#include "libANGLE/renderer/ContextImpl.h"
+#include "libANGLE/renderer/d3d/ContextD3D.h"
#include "libANGLE/renderer/d3d/RenderTargetD3D.h"
#include "libANGLE/renderer/d3d/RenderbufferD3D.h"
#include "libANGLE/renderer/d3d/RendererD3D.h"
@@ -259,13 +260,16 @@
const gl::InternalFormat &sizedFormatInfo = gl::GetInternalFormatInfo(format, type);
+ ContextD3D *contextD3D = GetImplAs<ContextD3D>(context);
+
GLuint outputPitch = 0;
- ANGLE_TRY_CHECKED_MATH(sizedFormatInfo.computeRowPitch(
- type, origArea.width, packState.alignment, packState.rowLength, &outputPitch));
+ ANGLE_CHECK_HR_MATH(contextD3D,
+ sizedFormatInfo.computeRowPitch(type, origArea.width, packState.alignment,
+ packState.rowLength, &outputPitch));
GLuint outputSkipBytes = 0;
- ANGLE_TRY_CHECKED_MATH(
- sizedFormatInfo.computeSkipBytes(type, outputPitch, 0, packState, false, &outputSkipBytes));
+ ANGLE_CHECK_HR_MATH(contextD3D, sizedFormatInfo.computeSkipBytes(
+ type, outputPitch, 0, packState, false, &outputSkipBytes));
outputSkipBytes +=
(area.x - origArea.x) * sizedFormatInfo.pixelBytes + (area.y - origArea.y) * outputPitch;