Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1411)

Unified Diff: gpu/ipc/service/direct_composition_surface_win.cc

Issue 2735853002: Offset scissor and viewport when using SetDrawRectangle on surface. (Closed)
Patch Set: remove flag Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/ipc/service/direct_composition_surface_win.h ('k') | ui/gl/gl_surface.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « gpu/ipc/service/direct_composition_surface_win.h ('k') | ui/gl/gl_surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698