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

Side by Side Diff: cc/render_surface_filters.cc

Issue 11196014: Revert "cc: Switch to Chromium DCHECKs LOGs" (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/render_pass_draw_quad.cc ('k') | cc/render_surface_impl.cc » ('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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 "CCRenderSurfaceFilters.h" 7 #include "CCRenderSurfaceFilters.h"
8 8
9 #include "base/logging.h"
10 #include "FloatSize.h" 9 #include "FloatSize.h"
11 #include "third_party/skia/include/core/SkCanvas.h" 10 #include "third_party/skia/include/core/SkCanvas.h"
12 #include "third_party/skia/include/effects/SkBlurImageFilter.h" 11 #include "third_party/skia/include/effects/SkBlurImageFilter.h"
13 #include "third_party/skia/include/effects/SkColorMatrixFilter.h" 12 #include "third_party/skia/include/effects/SkColorMatrixFilter.h"
14 #include "third_party/skia/include/effects/SkMagnifierImageFilter.h" 13 #include "third_party/skia/include/effects/SkMagnifierImageFilter.h"
15 #include "third_party/skia/include/gpu/SkGpuDevice.h" 14 #include "third_party/skia/include/gpu/SkGpuDevice.h"
16 #include "third_party/skia/include/gpu/SkGrPixelRef.h" 15 #include "third_party/skia/include/gpu/SkGrPixelRef.h"
17 #include <public/WebFilterOperation.h> 16 #include <public/WebFilterOperation.h>
18 #include <public/WebFilterOperations.h> 17 #include <public/WebFilterOperations.h>
19 #include <public/WebGraphicsContext3D.h> 18 #include <public/WebGraphicsContext3D.h>
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 m_canvas.reset(0); 287 m_canvas.reset(0);
289 m_device.reset(0); 288 m_device.reset(0);
290 289
291 m_source.setPixelRef(new SkGrPixelRef(m_scratchTextures[m_currentTexture ].get()))->unref(); 290 m_source.setPixelRef(new SkGrPixelRef(m_scratchTextures[m_currentTexture ].get()))->unref();
292 m_currentTexture = 1 - m_currentTexture; 291 m_currentTexture = 1 - m_currentTexture;
293 } 292 }
294 293
295 private: 294 private:
296 void createCanvas() 295 void createCanvas()
297 { 296 {
298 DCHECK(m_scratchTextures[m_currentTexture].get()); 297 ASSERT(m_scratchTextures[m_currentTexture].get());
299 m_device.reset(new SkGpuDevice(m_grContext, m_scratchTextures[m_currentT exture].get())); 298 m_device.reset(new SkGpuDevice(m_grContext, m_scratchTextures[m_currentT exture].get()));
300 m_canvas.reset(new SkCanvas(m_device.get())); 299 m_canvas.reset(new SkCanvas(m_device.get()));
301 m_canvas->clear(0x0); 300 m_canvas->clear(0x0);
302 } 301 }
303 302
304 GrContext* m_grContext; 303 GrContext* m_grContext;
305 SkBitmap m_source; 304 SkBitmap m_source;
306 SkAutoTUnref<GrTexture> m_scratchTextures[2]; 305 SkAutoTUnref<GrTexture> m_scratchTextures[2];
307 int m_currentTexture; 306 int m_currentTexture;
308 SkAutoTUnref<SkGpuDevice> m_device; 307 SkAutoTUnref<SkGpuDevice> m_device;
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
425 break; 424 break;
426 } 425 }
427 case WebKit::WebFilterOperation::FilterTypeBrightness: 426 case WebKit::WebFilterOperation::FilterTypeBrightness:
428 case WebKit::WebFilterOperation::FilterTypeContrast: 427 case WebKit::WebFilterOperation::FilterTypeContrast:
429 case WebKit::WebFilterOperation::FilterTypeGrayscale: 428 case WebKit::WebFilterOperation::FilterTypeGrayscale:
430 case WebKit::WebFilterOperation::FilterTypeSepia: 429 case WebKit::WebFilterOperation::FilterTypeSepia:
431 case WebKit::WebFilterOperation::FilterTypeSaturate: 430 case WebKit::WebFilterOperation::FilterTypeSaturate:
432 case WebKit::WebFilterOperation::FilterTypeHueRotate: 431 case WebKit::WebFilterOperation::FilterTypeHueRotate:
433 case WebKit::WebFilterOperation::FilterTypeInvert: 432 case WebKit::WebFilterOperation::FilterTypeInvert:
434 case WebKit::WebFilterOperation::FilterTypeOpacity: 433 case WebKit::WebFilterOperation::FilterTypeOpacity:
435 NOTREACHED(); 434 ASSERT_NOT_REACHED();
436 break; 435 break;
437 } 436 }
438 state.swap(); 437 state.swap();
439 } 438 }
440 context3D->flush(); 439 context3D->flush();
441 return state.source(); 440 return state.source();
442 } 441 }
443 442
444 } 443 }
OLDNEW
« no previous file with comments | « cc/render_pass_draw_quad.cc ('k') | cc/render_surface_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698