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

Side by Side Diff: cc/tiled_layer_impl.cc

Issue 11150025: Patch from https://codereview.chromium.org/11111005/ without actual file deletes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/tiled_layer.cc ('k') | cc/video_layer_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 6
7 #include "CCTiledLayerImpl.h" 7 #include "CCTiledLayerImpl.h"
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/stringprintf.h" 10 #include "base/stringprintf.h"
11 #include "third_party/khronos/GLES2/gl2.h"
11 #include "CCAppendQuadsData.h" 12 #include "CCAppendQuadsData.h"
12 #include "CCCheckerboardDrawQuad.h" 13 #include "CCCheckerboardDrawQuad.h"
13 #include "CCDebugBorderDrawQuad.h" 14 #include "CCDebugBorderDrawQuad.h"
14 #include "CCLayerTilingData.h" 15 #include "CCLayerTilingData.h"
15 #include "CCMathUtil.h" 16 #include "CCMathUtil.h"
16 #include "CCQuadSink.h" 17 #include "CCQuadSink.h"
17 #include "CCSolidColorDrawQuad.h" 18 #include "CCSolidColorDrawQuad.h"
18 #include "CCTileDrawQuad.h" 19 #include "CCTileDrawQuad.h"
19 #include "FloatQuad.h" 20 #include "FloatQuad.h"
20 #include "GraphicsContext3D.h"
21 #include "SkColor.h" 21 #include "SkColor.h"
22 22
23 using namespace std; 23 using namespace std;
24 using WebKit::WebTransformationMatrix; 24 using WebKit::WebTransformationMatrix;
25 25
26 namespace cc { 26 namespace cc {
27 27
28 static const int debugTileBorderWidth = 1; 28 static const int debugTileBorderWidth = 1;
29 static const int debugTileBorderAlpha = 100; 29 static const int debugTileBorderAlpha = 100;
30 static const int debugTileBorderColorRed = 80; 30 static const int debugTileBorderColorRed = 80;
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 bool clipped = false; 187 bool clipped = false;
188 FloatQuad visibleContentInTargetQuad = CCMathUtil::mapQuad(drawTrans form(), FloatQuad(visibleContentRect()), clipped); 188 FloatQuad visibleContentInTargetQuad = CCMathUtil::mapQuad(drawTrans form(), FloatQuad(visibleContentRect()), clipped);
189 bool isAxisAlignedInTarget = !clipped && visibleContentInTargetQuad. isRectilinear(); 189 bool isAxisAlignedInTarget = !clipped && visibleContentInTargetQuad. isRectilinear();
190 bool useAA = m_tiler->hasBorderTexels() && !isAxisAlignedInTarget; 190 bool useAA = m_tiler->hasBorderTexels() && !isAxisAlignedInTarget;
191 191
192 bool leftEdgeAA = !i && useAA; 192 bool leftEdgeAA = !i && useAA;
193 bool topEdgeAA = !j && useAA; 193 bool topEdgeAA = !j && useAA;
194 bool rightEdgeAA = i == m_tiler->numTilesX() - 1 && useAA; 194 bool rightEdgeAA = i == m_tiler->numTilesX() - 1 && useAA;
195 bool bottomEdgeAA = j == m_tiler->numTilesY() - 1 && useAA; 195 bool bottomEdgeAA = j == m_tiler->numTilesY() - 1 && useAA;
196 196
197 const GC3Dint textureFilter = m_tiler->hasBorderTexels() ? GraphicsC ontext3D::LINEAR : GraphicsContext3D::NEAREST; 197 const GLint textureFilter = m_tiler->hasBorderTexels() ? GL_LINEAR : GL_NEAREST;
198 quadSink.append(CCTileDrawQuad::create(sharedQuadState, tileRect, ti leOpaqueRect, tile->resourceId(), textureOffset, textureSize, textureFilter, con tentsSwizzled(), leftEdgeAA, topEdgeAA, rightEdgeAA, bottomEdgeAA).PassAs<CCDraw Quad>(), appendQuadsData); 198 quadSink.append(CCTileDrawQuad::create(sharedQuadState, tileRect, ti leOpaqueRect, tile->resourceId(), textureOffset, textureSize, textureFilter, con tentsSwizzled(), leftEdgeAA, topEdgeAA, rightEdgeAA, bottomEdgeAA).PassAs<CCDraw Quad>(), appendQuadsData);
199 } 199 }
200 } 200 }
201 } 201 }
202 202
203 void CCTiledLayerImpl::setTilingData(const CCLayerTilingData& tiler) 203 void CCTiledLayerImpl::setTilingData(const CCLayerTilingData& tiler)
204 { 204 {
205 if (m_tiler) 205 if (m_tiler)
206 m_tiler->reset(); 206 m_tiler->reset();
207 else 207 else
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 { 240 {
241 m_tiler->reset(); 241 m_tiler->reset();
242 } 242 }
243 243
244 const char* CCTiledLayerImpl::layerTypeAsString() const 244 const char* CCTiledLayerImpl::layerTypeAsString() const
245 { 245 {
246 return "ContentLayer"; 246 return "ContentLayer";
247 } 247 }
248 248
249 } // namespace cc 249 } // namespace cc
OLDNEW
« no previous file with comments | « cc/tiled_layer.cc ('k') | cc/video_layer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698