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

Issue 2402273002: DrawingBuffer: Clean up GL state restoration (Closed)

Created:
4 years, 2 months ago by ccameron
Modified:
4 years, 2 months ago
CC:
chromium-reviews, krit, drott+blinkwatch_chromium.org, blink-reviews-platform-graphics_chromium.org, dshwang, pdr+graphicswatchlist_chromium.org, jbroman, Justin Novosad, haraken, Rik, f(malita), blink-reviews, piman+watch_chromium.org, danakj+watch_chromium.org, ajuma+watch_chromium.org, Stephen Chennney, rwlbuis
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

DrawingBuffer: Clean up GL state restoration Several of DrawingBuffer's methods leave the caller's state dirty, and the responsibility for restoring this state comes in three forms: - Responsibility of DrawingBuffer. - E.g, DrawingBuffer::PrepareTextureMailbox, which calls DrawingBuffer::finishPrepareTextureMailboxGpu, which restores texture and framebuffer bindings. - Responsibility of the caller - E.g, WebGLRenderingContextBase::restoreStateAfterClear and everything that calls it. - Except.. - Both, together, in strange ways. That is, the caller will explicitly restore some state, but it will also call into DrawingBuffer to restore some of the state - E.g, WebGLRenderingContextBase::reshape, where we have all sorts of state restore calls, from all sorts of places. Note how strange it is to have WebGLRenderingContextBase call DrawingBuffer to have it restore state. WebGLRenderingContextBase is the structure that knows the values to restore -- DrawingBuffer only knows these values because WebGLRenderingContextBase told them to it. Get rid of all of the state tracking in DrawingBuffer. Instead, have it call back to its Client (WebGLRenderingContextBase) to restore state at the end of all of its public entrypoints. There exists no testing for this state restoration. Sprinkle "verify that state was restored correctly" calls throughout the existing tests. Also, make some method names more sensical. Change "commit" to a name that reflects what it does and the state changes associated with it. Change "reset" to "resize". BUG=648707 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.win:win_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel Committed: https://crrev.com/123016bf9ed08d599540dddc9a3b92a0df7eba2e Cr-Commit-Position: refs/heads/master@{#426686}

Patch Set 1 #

Total comments: 4

Patch Set 2 : Use built-in methods #

Total comments: 9

Patch Set 3 : Add comments for size check #

Patch Set 4 : fix compile #

Patch Set 5 : Fix state update #

Patch Set 6 : Remove conditional in texture binding #

Patch Set 7 : Rebase #

Patch Set 8 : Incorporate review feedback #

Messages

Total messages: 44 (34 generated)
ccameron
I think this is the last of the clean-up here. I may have gone overboard ...
4 years, 2 months ago (2016-10-09 21:10:54 UTC) #9
erikchen
lgtm. Good cleanup, good tests. :) https://codereview.chromium.org/2402273002/diff/20001/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp File third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp (right): https://codereview.chromium.org/2402273002/diff/20001/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp#newcode7383 third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp:7383: if (m_activeTextureUnit < ...
4 years, 2 months ago (2016-10-10 21:43:03 UTC) #10
Ken Russell (switch to Gerrit)
Thanks for pitching in to clean up this code. It's gotten complicated over the past ...
4 years, 2 months ago (2016-10-11 06:21:57 UTC) #11
erikchen
> > https://codereview.chromium.org/2402273002/diff/20001/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.h > File third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.h (right): > > https://codereview.chromium.org/2402273002/diff/20001/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.h#newcode419 > third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.h:419: Client* > m_client ...
4 years, 2 months ago (2016-10-11 06:33:04 UTC) #12
Ken Russell (switch to Gerrit)
On 2016/10/11 06:33:04, erikchen wrote: > > > > > https://codereview.chromium.org/2402273002/diff/20001/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.h > > File third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.h ...
4 years, 2 months ago (2016-10-11 22:53:56 UTC) #13
Ken Russell (switch to Gerrit)
On 2016/10/11 22:53:56, Ken Russell wrote: > On 2016/10/11 06:33:04, erikchen wrote: > > > ...
4 years, 2 months ago (2016-10-12 00:32:14 UTC) #14
ccameron
Thanks! I may clean up a little bit more of the state tracking to make ...
4 years, 2 months ago (2016-10-20 23:50:46 UTC) #37
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2402273002/140001
4 years, 2 months ago (2016-10-21 00:26:53 UTC) #41
commit-bot: I haz the power
Committed patchset #8 (id:140001)
4 years, 2 months ago (2016-10-21 02:06:15 UTC) #42
commit-bot: I haz the power
4 years, 2 months ago (2016-10-21 13:26:02 UTC) #44
Message was sent while issue was closed.
Patchset 8 (id:??) landed as
https://crrev.com/123016bf9ed08d599540dddc9a3b92a0df7eba2e
Cr-Commit-Position: refs/heads/master@{#426686}

Powered by Google App Engine
This is Rietveld 408576698