diff options
author | jamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-13 21:48:42 +0000 |
---|---|---|
committer | jamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-13 21:48:42 +0000 |
commit | 0457b750e0029599ef7bf8c470e120dda025fec2 (patch) | |
tree | 2a07f56243019f1375d3d790ad34e464e4cc4169 /cc | |
parent | e2187871e38b3a119771c1f30664a8cd7bffed5f (diff) | |
download | chromium_src-0457b750e0029599ef7bf8c470e120dda025fec2.zip chromium_src-0457b750e0029599ef7bf8c470e120dda025fec2.tar.gz chromium_src-0457b750e0029599ef7bf8c470e120dda025fec2.tar.bz2 |
Avoid redundantly setting tex parameters
BUG=
Review URL: https://chromiumcodereview.appspot.com/11366199
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167479 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc')
-rw-r--r-- | cc/draw_quad_unittest.cc | 9 | ||||
-rw-r--r-- | cc/gl_renderer.cc | 13 | ||||
-rw-r--r-- | cc/gl_renderer_unittest.cc | 22 | ||||
-rw-r--r-- | cc/layer_tree_host_impl_unittest.cc | 16 | ||||
-rw-r--r-- | cc/resource_provider.cc | 10 | ||||
-rw-r--r-- | cc/software_renderer.cc | 3 | ||||
-rw-r--r-- | cc/software_renderer_unittest.cc | 4 | ||||
-rw-r--r-- | cc/test/render_pass_test_common.cc | 2 | ||||
-rw-r--r-- | cc/tile_draw_quad.cc | 7 | ||||
-rw-r--r-- | cc/tile_draw_quad.h | 6 | ||||
-rw-r--r-- | cc/tiled_layer_impl.cc | 3 |
11 files changed, 48 insertions, 47 deletions
diff --git a/cc/draw_quad_unittest.cc b/cc/draw_quad_unittest.cc index 2a60905..2d84315 100644 --- a/cc/draw_quad_unittest.cc +++ b/cc/draw_quad_unittest.cc @@ -150,11 +150,6 @@ void compareDrawQuad(DrawQuad* quad, DrawQuad* copy, SharedQuadState* copyShared scoped_ptr<Type> quad(Type::create(sharedState.get(), quadRect, a, b, c, d, e, f, g, h, i)); \ SETUP_AND_COPY_QUAD(Type, quad); -#define CREATE_QUAD_10(Type, a, b, c, d, e, f, g, h, i, j) \ - QUAD_DATA \ - scoped_ptr<Type> quad(Type::create(sharedState.get(), quadRect, a, b, c, d, e, f, g, h, i, j)); \ - SETUP_AND_COPY_QUAD(Type, quad); - TEST(DrawQuadTest, copyCheckerboardDrawQuad) { SkColor color = 0xfabb0011; @@ -252,7 +247,6 @@ TEST(DrawQuadTest, copyTileDrawQuad) unsigned resourceId = 104; gfx::Vector2d textureOffset(-31, 47); gfx::Size textureSize(85, 32); - GLint textureFilter = 82; bool swizzleContents = true; bool leftEdgeAA = true; bool topEdgeAA = true; @@ -260,12 +254,11 @@ TEST(DrawQuadTest, copyTileDrawQuad) bool bottomEdgeAA = true; CREATE_SHARED_STATE(); - CREATE_QUAD_10(TileDrawQuad, opaqueRect, resourceId, textureOffset, textureSize, textureFilter, swizzleContents, leftEdgeAA, topEdgeAA, rightEdgeAA, bottomEdgeAA); + CREATE_QUAD_9(TileDrawQuad, opaqueRect, resourceId, textureOffset, textureSize, swizzleContents, leftEdgeAA, topEdgeAA, rightEdgeAA, bottomEdgeAA); EXPECT_RECT_EQ(opaqueRect, copyQuad->opaqueRect()); EXPECT_EQ(resourceId, copyQuad->resourceId()); EXPECT_EQ(textureOffset, copyQuad->textureOffset()); EXPECT_EQ(textureSize, copyQuad->textureSize()); - EXPECT_EQ(textureFilter, copyQuad->textureFilter()); EXPECT_EQ(swizzleContents, copyQuad->swizzleContents()); EXPECT_EQ(leftEdgeAA, copyQuad->leftEdgeAA()); EXPECT_EQ(topEdgeAA, copyQuad->topEdgeAA()); diff --git a/cc/gl_renderer.cc b/cc/gl_renderer.cc index dd46db2..8490d82 100644 --- a/cc/gl_renderer.cc +++ b/cc/gl_renderer.cc @@ -760,8 +760,6 @@ void GLRenderer::drawTileQuad(const DrawingFrame& frame, const TileDrawQuad* qua GLC(context(), context()->uniform1i(uniforms.samplerLocation, 0)); ResourceProvider::ScopedReadLockGL quadResourceLock(m_resourceProvider, quad->resourceId()); GLC(context(), context()->bindTexture(GL_TEXTURE_2D, quadResourceLock.textureId())); - GLC(context(), context()->texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, quad->textureFilter())); - GLC(context(), context()->texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, quad->textureFilter())); bool useAA = !clipped && quad->isAntialiased(); if (useAA) { @@ -970,13 +968,6 @@ void GLRenderer::drawTextureQuad(const DrawingFrame& frame, const TextureDrawQua ResourceProvider::ScopedReadLockGL quadResourceLock(m_resourceProvider, quad->resourceId()); GLC(context(), context()->bindTexture(GL_TEXTURE_2D, quadResourceLock.textureId())); - // FIXME: setting the texture parameters every time is redundant. Move this code somewhere - // where it will only happen once per texture. - GLC(context(), context()->texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR)); - GLC(context(), context()->texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR)); - GLC(context(), context()->texParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE)); - GLC(context(), context()->texParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE)); - if (!quad->premultipliedAlpha()) { // As it turns out, the premultiplied alpha blending function (ONE, ONE_MINUS_SRC_ALPHA) // will never cause the alpha channel to be set to anything less than 1.0 if it is @@ -1088,10 +1079,6 @@ void GLRenderer::copyTextureToFramebuffer(const DrawingFrame& frame, int texture const RenderPassProgram* program = renderPassProgram(); GLC(context(), context()->bindTexture(GL_TEXTURE_2D, textureId)); - GLC(context(), context()->texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR)); - GLC(context(), context()->texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR)); - GLC(context(), context()->texParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE)); - GLC(context(), context()->texParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE)); GLC(context(), context()->useProgram(program->program())); GLC(context(), context()->uniform1i(program->fragmentShader().samplerLocation(), 0)); diff --git a/cc/gl_renderer_unittest.cc b/cc/gl_renderer_unittest.cc index b530b7b..eb5f1fb 100644 --- a/cc/gl_renderer_unittest.cc +++ b/cc/gl_renderer_unittest.cc @@ -485,10 +485,11 @@ TEST(GLRendererTest2, visibilityChangeIsLastCall) } -class ActiveTextureTrackingContext : public FakeWebGraphicsContext3D { +class TextureStateTrackingContext : public FakeWebGraphicsContext3D { public: - ActiveTextureTrackingContext() + TextureStateTrackingContext() : m_activeTexture(GL_INVALID_ENUM) + , m_inDraw(false) { } @@ -499,6 +500,16 @@ public: return WebString(); } + // We shouldn't set any texture parameters during the draw sequence, although + // we might when creating the quads. + void setInDraw() { m_inDraw = true; } + + virtual void texParameteri(WGC3Denum target, WGC3Denum pname, WGC3Dint param) + { + if (m_inDraw) + ADD_FAILURE(); + } + virtual void activeTexture(WGC3Denum texture) { EXPECT_NE(texture, m_activeTexture); @@ -508,14 +519,15 @@ public: WGC3Denum activeTexture() const { return m_activeTexture; } private: + bool m_inDraw; WGC3Denum m_activeTexture; }; TEST(GLRendererTest2, activeTextureState) { FakeRendererClient fakeClient; - scoped_ptr<GraphicsContext> outputSurface(FakeWebCompositorOutputSurface::create(scoped_ptr<WebKit::WebGraphicsContext3D>(new ActiveTextureTrackingContext))); - ActiveTextureTrackingContext* context = static_cast<ActiveTextureTrackingContext*>(outputSurface->context3D()); + scoped_ptr<GraphicsContext> outputSurface(FakeWebCompositorOutputSurface::create(scoped_ptr<WebKit::WebGraphicsContext3D>(new TextureStateTrackingContext))); + TextureStateTrackingContext* context = static_cast<TextureStateTrackingContext*>(outputSurface->context3D()); scoped_ptr<ResourceProvider> resourceProvider(ResourceProvider::create(outputSurface.get())); FakeRendererGL renderer(&fakeClient, resourceProvider.get()); @@ -525,6 +537,8 @@ TEST(GLRendererTest2, activeTextureState) scoped_ptr<TestRenderPass> pass = TestRenderPass::create(id, gfx::Rect(0, 0, 100, 100), WebTransformationMatrix()); pass->appendOneOfEveryQuadType(resourceProvider.get()); + context->setInDraw(); + cc::DirectRenderer::DrawingFrame drawingFrame; renderer.beginDrawingFrame(drawingFrame); EXPECT_EQ(context->activeTexture(), GL_TEXTURE0); diff --git a/cc/layer_tree_host_impl_unittest.cc b/cc/layer_tree_host_impl_unittest.cc index 78691d9..ce71ced 100644 --- a/cc/layer_tree_host_impl_unittest.cc +++ b/cc/layer_tree_host_impl_unittest.cc @@ -1557,7 +1557,7 @@ public: opaqueRect = m_opaqueContentRect; SharedQuadState* sharedQuadState = quadSink.useSharedQuadState(createSharedQuadState()); - scoped_ptr<TileDrawQuad> testBlendingDrawQuad = TileDrawQuad::create(sharedQuadState, m_quadRect, opaqueRect, m_resourceId, gfx::Vector2d(), gfx::Size(1, 1), 0, false, false, false, false, false); + scoped_ptr<TileDrawQuad> testBlendingDrawQuad = TileDrawQuad::create(sharedQuadState, m_quadRect, opaqueRect, m_resourceId, gfx::Vector2d(), gfx::Size(1, 1), false, false, false, false, false); testBlendingDrawQuad->setQuadVisibleRect(m_quadVisibleRect); EXPECT_EQ(m_blend, testBlendingDrawQuad->needsBlending()); EXPECT_EQ(m_hasRenderSurface, !!renderSurface()); @@ -2457,7 +2457,7 @@ public: StrictWebGraphicsContext3D() : FakeWebGraphicsContext3D() { - m_nextTextureId = 7; // Start allocating texture ids larger than any other resource IDs so we can tell if someone's mixing up their resource types. + m_nextTextureId = 8; // Start allocating texture ids larger than any other resource IDs so we can tell if someone's mixing up their resource types. } virtual WebGLId createBuffer() { return 2; } @@ -2466,6 +2466,8 @@ public: virtual WebGLId createRenderbuffer() { return 5; } virtual WebGLId createShader(WGC3Denum) { return 6; } + static const WebGLId kExternalTextureId = 7; + virtual void deleteBuffer(WebGLId id) { if (id != 2) @@ -2504,6 +2506,8 @@ public: } virtual void deleteTexture(WebGLId id) { + if (id == kExternalTextureId) + ADD_FAILURE() << "Trying to delete external texture"; if (!ContainsKey(m_allocatedTextureIds, id)) ADD_FAILURE() << "Trying to delete texture id " << id; m_allocatedTextureIds.erase(id); @@ -2541,7 +2545,7 @@ public: virtual void bindTexture(WGC3Denum, WebGLId id) { - if (id && !ContainsKey(m_allocatedTextureIds, id)) + if (id && id != kExternalTextureId && !ContainsKey(m_allocatedTextureIds, id)) ADD_FAILURE() << "Trying to bind texture id " << id; } @@ -2699,7 +2703,7 @@ TEST_P(LayerTreeHostImplTest, dontUseOldResourcesAfterLostContext) textureLayer->setAnchorPoint(gfx::PointF(0, 0)); textureLayer->setContentBounds(gfx::Size(10, 10)); textureLayer->setDrawsContent(true); - textureLayer->setTextureId(1); + textureLayer->setTextureId(StrictWebGraphicsContext3D::kExternalTextureId); rootLayer->addChild(textureLayer.PassAs<LayerImpl>()); scoped_ptr<TiledLayerImpl> maskLayer = TiledLayerImpl::create(layerId++); @@ -2716,7 +2720,7 @@ TEST_P(LayerTreeHostImplTest, dontUseOldResourcesAfterLostContext) textureLayerWithMask->setAnchorPoint(gfx::PointF(0, 0)); textureLayerWithMask->setContentBounds(gfx::Size(10, 10)); textureLayerWithMask->setDrawsContent(true); - textureLayerWithMask->setTextureId(1); + textureLayerWithMask->setTextureId(StrictWebGraphicsContext3D::kExternalTextureId); textureLayerWithMask->setMaskLayer(maskLayer.PassAs<LayerImpl>()); rootLayer->addChild(textureLayerWithMask.PassAs<LayerImpl>()); @@ -2825,7 +2829,7 @@ TEST_P(LayerTreeHostImplTest, dontUseOldResourcesAfterLostContext) // Create dummy resources so that looking up an old resource will get an // invalid texture id mapping. for (unsigned i = 0; i < numResources; ++i) - m_hostImpl->resourceProvider()->createResourceFromExternalTexture(1); + m_hostImpl->resourceProvider()->createResourceFromExternalTexture(StrictWebGraphicsContext3D::kExternalTextureId); // The WebVideoFrameProvider is expected to recreate its textures after a // lost context (or not serve a frame). diff --git a/cc/resource_provider.cc b/cc/resource_provider.cc index 0107e82..4269b81 100644 --- a/cc/resource_provider.cc +++ b/cc/resource_provider.cc @@ -188,7 +188,15 @@ ResourceProvider::ResourceId ResourceProvider::createBitmap(int pool, const gfx: ResourceProvider::ResourceId ResourceProvider::createResourceFromExternalTexture(unsigned textureId) { DCHECK(m_threadChecker.CalledOnValidThread()); - DCHECK(m_context->context3D()); + + WebGraphicsContext3D* context3d = m_context->context3D(); + DCHECK(context3d); + GLC(context3d, context3d->bindTexture(GL_TEXTURE_2D, textureId)); + GLC(context3d, context3d->texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR)); + GLC(context3d, context3d->texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR)); + GLC(context3d, context3d->texParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE)); + GLC(context3d, context3d->texParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE)); + ResourceId id = m_nextId++; Resource resource(textureId, 0, gfx::Size(), 0); resource.external = true; diff --git a/cc/software_renderer.cc b/cc/software_renderer.cc index 78a9229..565218a 100644 --- a/cc/software_renderer.cc +++ b/cc/software_renderer.cc @@ -265,8 +265,7 @@ void SoftwareRenderer::drawTileQuad(const DrawingFrame& frame, const TileDrawQua SkRect uvRect = SkRect::MakeXYWH( quad->textureOffset().x(), quad->textureOffset().y(), quad->quadRect().width(), quad->quadRect().height()); - if (quad->textureFilter() != GL_NEAREST) - m_skCurrentPaint.setFilterBitmap(true); + m_skCurrentPaint.setFilterBitmap(true); m_skCurrentCanvas->drawBitmapRectToRect(*lock.skBitmap(), &uvRect, toSkRect(quadVertexRect()), &m_skCurrentPaint); diff --git a/cc/software_renderer_unittest.cc b/cc/software_renderer_unittest.cc index a190890..bdcff11 100644 --- a/cc/software_renderer_unittest.cc +++ b/cc/software_renderer_unittest.cc @@ -128,8 +128,8 @@ TEST_F(SoftwareRendererTest, tileQuad) scoped_ptr<SharedQuadState> sharedQuadState = SharedQuadState::create(WebTransformationMatrix(), outerRect, outerRect, 1.0, true); RenderPass::Id rootRenderPassId = RenderPass::Id(1, 1); scoped_ptr<TestRenderPass> rootRenderPass = TestRenderPass::create(rootRenderPassId, gfx::Rect(gfx::Point(), deviceViewportSize()), WebTransformationMatrix()); - scoped_ptr<DrawQuad> outerQuad = TileDrawQuad::create(sharedQuadState.get(), outerRect, outerRect, resourceYellow, gfx::Vector2d(), outerSize, 0, false, false, false, false, false).PassAs<DrawQuad>(); - scoped_ptr<DrawQuad> innerQuad = TileDrawQuad::create(sharedQuadState.get(), innerRect, innerRect, resourceCyan, gfx::Vector2d(), innerSize, 0, false, false, false, false, false).PassAs<DrawQuad>(); + scoped_ptr<DrawQuad> outerQuad = TileDrawQuad::create(sharedQuadState.get(), outerRect, outerRect, resourceYellow, gfx::Vector2d(), outerSize, false, false, false, false, false).PassAs<DrawQuad>(); + scoped_ptr<DrawQuad> innerQuad = TileDrawQuad::create(sharedQuadState.get(), innerRect, innerRect, resourceCyan, gfx::Vector2d(), innerSize, false, false, false, false, false).PassAs<DrawQuad>(); rootRenderPass->appendQuad(innerQuad.Pass()); rootRenderPass->appendQuad(outerQuad.Pass()); diff --git a/cc/test/render_pass_test_common.cc b/cc/test/render_pass_test_common.cc index d3680e6..5c24596 100644 --- a/cc/test/render_pass_test_common.cc +++ b/cc/test/render_pass_test_common.cc @@ -39,7 +39,7 @@ void TestRenderPass::appendOneOfEveryQuadType(cc::ResourceProvider* resourceProv appendQuad(cc::StreamVideoDrawQuad::create(sharedState.get(), rect, 1, WebKit::WebTransformationMatrix()).PassAs<DrawQuad>()); appendQuad(cc::TextureDrawQuad::create(sharedState.get(), rect, textureResource, false, rect, false).PassAs<DrawQuad>()); - appendQuad(cc::TileDrawQuad::create(sharedState.get(), rect, rect, textureResource, gfx::Vector2d(), gfx::Size(100, 100), GL_LINEAR, false, false, false, false, false).PassAs<DrawQuad>()); + appendQuad(cc::TileDrawQuad::create(sharedState.get(), rect, rect, textureResource, gfx::Vector2d(), gfx::Size(100, 100), false, false, false, false, false).PassAs<DrawQuad>()); cc::VideoLayerImpl::FramePlane planes[3]; for (int i = 0; i < 3; ++i) { diff --git a/cc/tile_draw_quad.cc b/cc/tile_draw_quad.cc index 560dd05..0be0e00 100644 --- a/cc/tile_draw_quad.cc +++ b/cc/tile_draw_quad.cc @@ -9,17 +9,16 @@ namespace cc { -scoped_ptr<TileDrawQuad> TileDrawQuad::create(const SharedQuadState* sharedQuadState, const gfx::Rect& quadRect, const gfx::Rect& opaqueRect, unsigned resourceId, const gfx::Vector2d& textureOffset, const gfx::Size& textureSize, GLint textureFilter, bool swizzleContents, bool leftEdgeAA, bool topEdgeAA, bool rightEdgeAA, bool bottomEdgeAA) +scoped_ptr<TileDrawQuad> TileDrawQuad::create(const SharedQuadState* sharedQuadState, const gfx::Rect& quadRect, const gfx::Rect& opaqueRect, unsigned resourceId, const gfx::Vector2d& textureOffset, const gfx::Size& textureSize, bool swizzleContents, bool leftEdgeAA, bool topEdgeAA, bool rightEdgeAA, bool bottomEdgeAA) { - return make_scoped_ptr(new TileDrawQuad(sharedQuadState, quadRect, opaqueRect, resourceId, textureOffset, textureSize, textureFilter, swizzleContents, leftEdgeAA, topEdgeAA, rightEdgeAA, bottomEdgeAA)); + return make_scoped_ptr(new TileDrawQuad(sharedQuadState, quadRect, opaqueRect, resourceId, textureOffset, textureSize, swizzleContents, leftEdgeAA, topEdgeAA, rightEdgeAA, bottomEdgeAA)); } -TileDrawQuad::TileDrawQuad(const SharedQuadState* sharedQuadState, const gfx::Rect& quadRect, const gfx::Rect& opaqueRect, unsigned resourceId, const gfx::Vector2d& textureOffset, const gfx::Size& textureSize, GLint textureFilter, bool swizzleContents, bool leftEdgeAA, bool topEdgeAA, bool rightEdgeAA, bool bottomEdgeAA) +TileDrawQuad::TileDrawQuad(const SharedQuadState* sharedQuadState, const gfx::Rect& quadRect, const gfx::Rect& opaqueRect, unsigned resourceId, const gfx::Vector2d& textureOffset, const gfx::Size& textureSize, bool swizzleContents, bool leftEdgeAA, bool topEdgeAA, bool rightEdgeAA, bool bottomEdgeAA) : DrawQuad(sharedQuadState, DrawQuad::TiledContent, quadRect) , m_resourceId(resourceId) , m_textureOffset(textureOffset) , m_textureSize(textureSize) - , m_textureFilter(textureFilter) , m_swizzleContents(swizzleContents) , m_leftEdgeAA(leftEdgeAA) , m_topEdgeAA(topEdgeAA) diff --git a/cc/tile_draw_quad.h b/cc/tile_draw_quad.h index c5a05ca..a772de8 100644 --- a/cc/tile_draw_quad.h +++ b/cc/tile_draw_quad.h @@ -18,12 +18,11 @@ namespace cc { class CC_EXPORT TileDrawQuad : public DrawQuad { public: - static scoped_ptr<TileDrawQuad> create(const SharedQuadState*, const gfx::Rect& quadRect, const gfx::Rect& opaqueRect, unsigned resourceId, const gfx::Vector2d& textureOffset, const gfx::Size& textureSize, GLint textureFilter, bool swizzleContents, bool leftEdgeAA, bool topEdgeAA, bool rightEdgeAA, bool bottomEdgeAA); + static scoped_ptr<TileDrawQuad> create(const SharedQuadState*, const gfx::Rect& quadRect, const gfx::Rect& opaqueRect, unsigned resourceId, const gfx::Vector2d& textureOffset, const gfx::Size& textureSize, bool swizzleContents, bool leftEdgeAA, bool topEdgeAA, bool rightEdgeAA, bool bottomEdgeAA); unsigned resourceId() const { return m_resourceId; } gfx::Vector2d textureOffset() const { return m_textureOffset; } gfx::Size textureSize() const { return m_textureSize; } - GLint textureFilter() const { return m_textureFilter; } bool swizzleContents() const { return m_swizzleContents; } bool leftEdgeAA() const { return m_leftEdgeAA; } @@ -35,12 +34,11 @@ public: static const TileDrawQuad* materialCast(const DrawQuad*); private: - TileDrawQuad(const SharedQuadState*, const gfx::Rect& quadRect, const gfx::Rect& opaqueRect, unsigned resourceId, const gfx::Vector2d& textureOffset, const gfx::Size& textureSize, GLint textureFilter, bool swizzleContents, bool leftEdgeAA, bool topEdgeAA, bool rightEdgeAA, bool bottomEdgeAA); + TileDrawQuad(const SharedQuadState*, const gfx::Rect& quadRect, const gfx::Rect& opaqueRect, unsigned resourceId, const gfx::Vector2d& textureOffset, const gfx::Size& textureSize, bool swizzleContents, bool leftEdgeAA, bool topEdgeAA, bool rightEdgeAA, bool bottomEdgeAA); unsigned m_resourceId; gfx::Vector2d m_textureOffset; gfx::Size m_textureSize; - GLint m_textureFilter; bool m_swizzleContents; bool m_leftEdgeAA; bool m_topEdgeAA; diff --git a/cc/tiled_layer_impl.cc b/cc/tiled_layer_impl.cc index 03ffc74..26aa4b2 100644 --- a/cc/tiled_layer_impl.cc +++ b/cc/tiled_layer_impl.cc @@ -196,8 +196,7 @@ void TiledLayerImpl::appendQuads(QuadSink& quadSink, AppendQuadsData& appendQuad bool rightEdgeAA = i == m_tiler->numTilesX() - 1 && useAA; bool bottomEdgeAA = j == m_tiler->numTilesY() - 1 && useAA; - const GLint textureFilter = m_tiler->hasBorderTexels() ? GL_LINEAR : GL_NEAREST; - quadSink.append(TileDrawQuad::create(sharedQuadState, tileRect, tileOpaqueRect, tile->resourceId(), textureOffset, textureSize, textureFilter, tile->contentsSwizzled(), leftEdgeAA, topEdgeAA, rightEdgeAA, bottomEdgeAA).PassAs<DrawQuad>(), appendQuadsData); + quadSink.append(TileDrawQuad::create(sharedQuadState, tileRect, tileOpaqueRect, tile->resourceId(), textureOffset, textureSize, tile->contentsSwizzled(), leftEdgeAA, topEdgeAA, rightEdgeAA, bottomEdgeAA).PassAs<DrawQuad>(), appendQuadsData); } } } |