Index: gpu/ipc/service/direct_composition_surface_win.cc |
diff --git a/gpu/ipc/service/direct_composition_surface_win.cc b/gpu/ipc/service/direct_composition_surface_win.cc |
index aea60f57a008658f164076b0161d7fe4c542590e..9454f787361fe6ff1eca8a0f557a58a889e2b946 100644 |
--- a/gpu/ipc/service/direct_composition_surface_win.cc |
+++ b/gpu/ipc/service/direct_composition_surface_win.cc |
@@ -295,7 +295,6 @@ bool DirectCompositionSurfaceWin::SetDrawRectangle(const gfx::Rect& rectangle) { |
ScopedReleaseCurrent release_current(this); |
RECT rect = rectangle.ToRECT(); |
- // TODO(jbauman): Use update_offset |
POINT update_offset; |
HRESULT hr = dcomp_surface_->BeginDraw( |
@@ -303,6 +302,8 @@ bool DirectCompositionSurfaceWin::SetDrawRectangle(const gfx::Rect& rectangle) { |
CHECK(SUCCEEDED(hr)); |
has_been_rendered_to_ = true; |
+ draw_offset_ = gfx::Point(update_offset) - gfx::Rect(rect).origin(); |
+ |
g_current_surface = dcomp_surface_.get(); |
std::vector<EGLint> pbuffer_attribs{ |
@@ -323,6 +324,10 @@ bool DirectCompositionSurfaceWin::SetDrawRectangle(const gfx::Rect& rectangle) { |
return true; |
} |
+gfx::Vector2d DirectCompositionSurfaceWin::GetDrawOffset() const { |
+ return draw_offset_; |
+} |
+ |
scoped_refptr<base::TaskRunner> |
DirectCompositionSurfaceWin::GetWindowTaskRunnerForTesting() { |
return child_window_.GetTaskRunnerForTesting(); |