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

Issue 11358181: Use nearest neighbor filtering for non-translated quads (Closed)

Created:
8 years, 1 month ago by Sami
Modified:
8 years ago
Reviewers:
danakj, jamesr, enne (OOO)
CC:
chromium-reviews, cc-bugs_chromium.org, Peter Beverloo
Visibility:
Public.

Description

Use nearest neighbor filtering for non-translated quads Draw tiled layer quads that only have a translation transformation component using nearest neighbor filtering instead of bilinear filtering. This has two advantages: 1. On some GPUs this can reduce memory bandwidth usage due to increased texture cache hit rate. 2. Linear filtering is known to give slightly different results on different GPUs because of differences in the texture sampling hardware. Avoiding bilinear filtering in the common case (i.e., when CSS transformation aren't used) makes WebKit layout test pixel dumps better comparable across different devices. TEST=ResourceProviderTest.ScopedSampler, GLRendererTest2.activeTextureState, manual testing with composited websites. BUG= Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=170944

Patch Set 1 #

Total comments: 4

Patch Set 2 : Use LINEAR for fractionally translated quads. #

Patch Set 3 : Associate resources with min/mag filters and use NEAREST for tile quads when feasible. #

Total comments: 11

Patch Set 4 : Use single filter for min/mag; fix bind order. #

Total comments: 1

Patch Set 5 : Also test negative translations. #

Total comments: 2

Patch Set 6 : Change CHECK() into DCHECK(). #

Unified diffs Side-by-side diffs Delta from patch set Stats (+241 lines, -44 lines) Patch
M cc/gl_renderer.cc View 1 2 3 6 chunks +15 lines, -21 lines 0 comments Download
M cc/gl_renderer_unittest.cc View 1 2 3 7 chunks +37 lines, -13 lines 0 comments Download
M cc/resource_provider.h View 1 2 3 4 chunks +17 lines, -2 lines 0 comments Download
M cc/resource_provider.cc View 1 2 3 4 5 10 chunks +34 lines, -6 lines 0 comments Download
M cc/resource_provider_unittest.cc View 1 2 3 3 chunks +58 lines, -0 lines 0 comments Download
M cc/test/render_pass_test_common.cc View 1 2 3 2 chunks +35 lines, -0 lines 0 comments Download
M cc/transferable_resource.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M cc/transferable_resource.cc View 1 2 3 1 chunk +3 lines, -2 lines 0 comments Download
M ui/gfx/transform.h View 1 2 3 1 chunk +4 lines, -0 lines 0 comments Download
M ui/gfx/transform.cc View 1 2 3 4 5 1 chunk +12 lines, -0 lines 0 comments Download
M ui/gfx/transform_unittest.cc View 1 2 3 4 1 chunk +25 lines, -0 lines 0 comments Download

Messages

Total messages: 23 (0 generated)
Sami
8 years, 1 month ago (2012-11-09 18:34:11 UTC) #1
jamesr
https://codereview.chromium.org/11358181/diff/1/cc/tiled_layer_impl.cc File cc/tiled_layer_impl.cc (right): https://codereview.chromium.org/11358181/diff/1/cc/tiled_layer_impl.cc#newcode201 cc/tiled_layer_impl.cc:201: const GLint textureFilter = m_tiler->hasBorderTexels() && !drawTransform().isIdentityOrTranslation() ? GL_LINEAR ...
8 years, 1 month ago (2012-11-09 18:40:09 UTC) #2
Sami
http://codereview.chromium.org/11358181/diff/1/cc/tiled_layer_impl.cc File cc/tiled_layer_impl.cc (right): http://codereview.chromium.org/11358181/diff/1/cc/tiled_layer_impl.cc#newcode201 cc/tiled_layer_impl.cc:201: const GLint textureFilter = m_tiler->hasBorderTexels() && !drawTransform().isIdentityOrTranslation() ? GL_LINEAR ...
8 years, 1 month ago (2012-11-11 16:56:26 UTC) #3
jamesr
Hmmmmmm - to cut down on texParameteri calls I've refactored this bit of code (specifically ...
8 years, 1 month ago (2012-11-16 01:33:19 UTC) #4
Sami
Yeah, we kind of crossed stream there. This version adds a min/mag filter setting to ...
8 years ago (2012-11-22 17:20:39 UTC) #5
jamesr
https://codereview.chromium.org/11358181/diff/12001/cc/gl_renderer.cc File cc/gl_renderer.cc (right): https://codereview.chromium.org/11358181/diff/12001/cc/gl_renderer.cc#newcode544 cc/gl_renderer.cc:544: context()->bindTexture(GL_TEXTURE_2D, texture->getTextureHandle()); you're moving a bind call up here ...
8 years ago (2012-11-26 06:54:26 UTC) #6
Sami
Sorry I let this sit for a bit, email filtering fail. This addresses all James' ...
8 years ago (2012-11-30 17:49:27 UTC) #7
danakj
https://codereview.chromium.org/11358181/diff/19001/ui/gfx/transform_unittest.cc File ui/gfx/transform_unittest.cc (right): https://codereview.chromium.org/11358181/diff/19001/ui/gfx/transform_unittest.cc#newcode1165 ui/gfx/transform_unittest.cc:1165: transform.Translate3d(1, 2, 3); Can you add negatives to this ...
8 years ago (2012-11-30 18:34:56 UTC) #8
Sami
On 2012/11/30 18:34:56, danakj wrote: > > ui/gfx/transform_unittest.cc:1165: transform.Translate3d(1, 2, 3); > Can you add ...
8 years ago (2012-11-30 18:45:55 UTC) #9
danakj
LGTM for ui/gfx I'll leave cc/ to jamesr
8 years ago (2012-11-30 18:48:36 UTC) #10
jamesr
cc lgtm https://codereview.chromium.org/11358181/diff/9002/cc/resource_provider.cc File cc/resource_provider.cc (right): https://codereview.chromium.org/11358181/diff/9002/cc/resource_provider.cc#newcode853 cc/resource_provider.cc:853: CHECK(it != m_resources.end()); why not DCHECK() ?
8 years ago (2012-12-01 01:50:22 UTC) #11
Sami
https://codereview.chromium.org/11358181/diff/9002/cc/resource_provider.cc File cc/resource_provider.cc (right): https://codereview.chromium.org/11358181/diff/9002/cc/resource_provider.cc#newcode853 cc/resource_provider.cc:853: CHECK(it != m_resources.end()); On 2012/12/01 01:50:22, jamesr wrote: > ...
8 years ago (2012-12-03 11:59:21 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/skyostil@chromium.org/11358181/16002
8 years ago (2012-12-03 11:59:41 UTC) #13
commit-bot: I haz the power
Retried try job too often on mac_rel for step(s) ash_unittests
8 years ago (2012-12-03 13:06:43 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/skyostil@chromium.org/11358181/16002
8 years ago (2012-12-03 15:20:02 UTC) #15
commit-bot: I haz the power
Retried try job too often on linux_rel for step(s) ash_unittests
8 years ago (2012-12-03 16:14:18 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/skyostil@chromium.org/11358181/16002
8 years ago (2012-12-03 17:10:26 UTC) #17
commit-bot: I haz the power
Retried try job too often on linux_rel for step(s) ash_unittests
8 years ago (2012-12-03 17:51:23 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/skyostil@chromium.org/11358181/16002
8 years ago (2012-12-03 18:10:40 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/skyostil@chromium.org/11358181/16002
8 years ago (2012-12-03 18:49:19 UTC) #20
commit-bot: I haz the power
Retried try job too often on win_rel for step(s) browser_tests
8 years ago (2012-12-03 23:58:44 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/skyostil@chromium.org/11358181/16002
8 years ago (2012-12-04 10:43:16 UTC) #22
commit-bot: I haz the power
8 years ago (2012-12-04 12:18:32 UTC) #23
Message was sent while issue was closed.
Change committed as 170944

Powered by Google App Engine
This is Rietveld 408576698