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

Unified Diff: cc/trees/layer_tree_host_impl_unittest.cc

Issue 138393002: replace etc1_pixel_ref with skia version (SkMallocPixelRef) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/resources/ui_resource_bitmap.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_impl_unittest.cc
diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc
index 05fc56ce08c9f96adc64b2e809adef5b1a0cf62f..31294e03579545fe7f2ad02d2e2cd395ca464860 100644
--- a/cc/trees/layer_tree_host_impl_unittest.cc
+++ b/cc/trees/layer_tree_host_impl_unittest.cc
@@ -35,7 +35,6 @@
#include "cc/quads/solid_color_draw_quad.h"
#include "cc/quads/texture_draw_quad.h"
#include "cc/quads/tile_draw_quad.h"
-#include "cc/resources/etc1_pixel_ref.h"
#include "cc/resources/layer_tiling_data.h"
#include "cc/test/animation_test_common.h"
#include "cc/test/fake_layer_tree_host_impl.h"
@@ -55,6 +54,7 @@
#include "media/base/media.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "third_party/skia/include/core/SkMallocPixelRef.h"
#include "ui/gfx/frame_time.h"
#include "ui/gfx/rect_conversions.h"
#include "ui/gfx/size_conversions.h"
@@ -5153,16 +5153,12 @@ TEST_F(LayerTreeHostImplTest, CreateETC1UIResource) {
EXPECT_EQ(0u, context3d->NumTextures());
- SkImageInfo info = {4, 4, kPMColor_SkColorType, kPremul_SkAlphaType};
- size_t rowBytes = info.minRowBytes();
- scoped_ptr<uint8_t[]> pixels(new uint8_t[rowBytes * info.fHeight]);
- skia::RefPtr<ETC1PixelRef> etc1_pixel_ref =
- skia::AdoptRef(new ETC1PixelRef(info, rowBytes, pixels.Pass()));
- UIResourceBitmap bitmap(etc1_pixel_ref, gfx::Size(info.fWidth, info.fHeight));
- // TODO(powel) Now that pixel_refs have info, the UIResourceBitmap
- // constructor can get the can size from (pixelref->info().fWidth,
- // pixelref->info().fHeight).
-
+ SkImageInfo info =
+ SkImageInfo::Make(4, 4, kPMColor_SkColorType, kPremul_SkAlphaType);
+ skia::RefPtr<SkPixelRef> pixel_ref =
+ skia::AdoptRef(SkMallocPixelRef::NewAllocate(info, 0, 0));
+ pixel_ref->setImmutable();
+ UIResourceBitmap bitmap(pixel_ref);
UIResourceId ui_resource_id = 1;
host_impl_->CreateUIResource(ui_resource_id, bitmap);
EXPECT_EQ(1u, context3d->NumTextures());
« no previous file with comments | « cc/resources/ui_resource_bitmap.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698